/** * Links an escalation to an {@link SectionOutput}. * * @param task * {@link SectionTask}. * @param exception * Type of escalation. * @param designer * {@link SectionDesigner}. * @param escalations * Registry of the {@link SectionOutput} by type of escalation. */ static <E extends Throwable> void linkEscalation(SectionTask task, Class<E> exception, SectionDesigner designer, Map<Class<?>, SectionOutput> escalations) { // Obtain the section output SectionOutput output = escalations.get(exception); if (output == null) { output = designer.addSectionOutput(exception.getName(), exception.getName(), true); escalations.put(exception, output); } // Link task escalation to output TaskFlow escalation = task.getTaskEscalation(exception.getName()); designer.link(escalation, output, FlowInstigationStrategyEnum.SEQUENTIAL); }
@Override public void sourceSection(SectionDesigner designer, SectionSourceContext context) throws Exception { SectionFunctionNamespace namespace = designer.addSectionFunctionNamespace("secure", new HttpFlowSecurerManagedFunctionSource(this.annotation)); SectionFunction function = namespace.addSectionFunction("secure", HttpFlowSecurerManagedFunctionSource.FUNCTION_NAME); designer.link(designer.addSectionInput(INPUT_NAME, null), function); designer.link(function.getFunctionFlow(Flows.SECURE.name()), designer.addSectionOutput(SECURE_OUTPUT_NAME, null, false), false); designer.link(function.getFunctionFlow(Flows.INSECURE.name()), designer.addSectionOutput(INSECURE_OUTPUT_NAME, null, false), false); } }
SectionOutput ioEscalationOutput = designer.addSectionOutput( IOException.class.getSimpleName(), IOException.class.getName(), true);
.addSectionOutput(PUBLISH_OUTPUT_PREFIX + outputFlowName, CometEvent.class.getName(), false), FlowInstigationStrategyEnum.SEQUENTIAL);
@Override public void sourceSection(SectionDesigner designer, SectionSourceContext context) throws Exception { final Map<Class<?>, SectionObject> objects = new HashMap<Class<?>, SectionObject>(); final Map<Class<?>, SectionOutput> escalations = new HashMap<Class<?>, SectionOutput>(); // Add file sender SectionWork sendFileWork = designer.addSectionWork("FILE", HttpFileSenderWorkSource.class.getName()); SourceHttpResourceFactory.copyProperties(context, sendFileWork); SectionTask sendFileTask = sendFileWork.addSectionTask( HttpFileSenderWorkSource.TASK_NAME, HttpFileSenderWorkSource.TASK_NAME); WebApplicationSectionSource.linkObject(sendFileTask, DependencyKeys.SERVER_HTTP_CONNECTION.name(), ServerHttpConnection.class, designer, objects); WebApplicationSectionSource.linkObject(sendFileTask, DependencyKeys.HTTP_APPLICATION_LOCATION.name(), HttpApplicationLocation.class, designer, objects); WebApplicationSectionSource.linkEscalation(sendFileTask, IOException.class, designer, escalations); WebApplicationSectionSource.linkEscalation(sendFileTask, InvalidHttpRequestUriException.class, designer, escalations); // Provide input to service SectionInput input = designer.addSectionInput(SERVICE_INPUT_NAME, null); designer.link(input, sendFileTask); // Provide output once file written SectionOutput output = designer.addSectionOutput(FILE_SENT_OUTPUT_NAME, null, false); designer.link(sendFileTask, output); }
SectionOutput output = designer.addSectionOutput(httpSecurityName, null, false); FunctionFlow flow = handler.getFunctionFlow(httpSecurityName); designer.link(flow, output, false);
SectionOutput redirectOutput = designer.addSectionOutput(REDIRECT_TEMPLATE_OUTPUT_NAME, null, false); FunctionFlow templateRedirectFlow = initialFunction.getFunctionFlow(Flows.REDIRECT.name()); String redirectValuesFunctionName = context.getProperty(PROPERTY_REDIRECT_VALUES_FUNCTION, null);
String flowName = flowType.getFlowName(); FunctionFlow functionFlow = challengeFunction.getFunctionFlow("Flow_" + flowName); SectionOutput sectionOutput = designer.addSectionOutput(flowName, flowType.getArgumentType().getName(), false); designer.link(functionFlow, sectionOutput, false); designer.link(completeAuthFunction, designer.addSectionOutput(OUTPUT_RECONTINUE, null, false));
SectionOutput unhandledOutput = designer.addSectionOutput(UNHANDLED_OUTPUT, null, false); SectionOutput servletExceptionOutput = designer.addSectionOutput(ServletException.class.getSimpleName(), ServletException.class.getName(), true); SectionOutput ioExceptionOutput = designer.addSectionOutput(IOException.class.getSimpleName(), IOException.class.getName(), true);
SectionOutput unhandledRequestOutput = designer.addSectionOutput( UNHANDLED_REQUEST_OUTPUT_NAME, null, false); designer.link(unhandledServiceFlow, unhandledRequestOutput,
SectionOutput failureOutput = designer.addSectionOutput(OUTPUT_FAILURE, Throwable.class.getName(), true); } else { sectionOutput = designer.addSectionOutput(flowName, flowType.getArgumentType().getName(), false); designer.link(completeAuthTask, designer.addSectionOutput(OUTPUT_RECONTINUE, null, false));
SectionOutput interceptOutput = designer.addSectionOutput(this.interception.outputName, null, false); designer.link(intercept, interceptOutput); SectionOutput output = designer.addSectionOutput(outputName, null, false); SectionOutput unhandled = designer.addSectionOutput(UNHANDLED_OUTPUT_NAME, null, false); designer.link(route.getFunctionFlow(UNHANDLED_OUTPUT_NAME), unhandled, false); designer.link(handleRedirect.getFunctionFlow(UNHANDLED_OUTPUT_NAME), unhandled, false); SectionOutput notFoundEscalation = designer.addSectionOutput(NotFoundHttpException.class.getSimpleName(), NotFoundHttpException.class.getName(), true); designer.link(notFound.getFunctionEscalation(NotFoundHttpException.class.getName()), notFoundEscalation, true);