SectionFunctionNamespace namespace = designer.addSectionFunctionNamespace("handle", new HandleAuthenticationRequiredManagedFunctionSource()); SectionFunction handler = namespace.addSectionFunction("handler", "handler");
@Override public SectionFlowSinkNode secureFlow(SectionDesigner designer, Class<?> argumentType, SectionFlowSinkNode secureFlowSink, SectionFlowSinkNode insecureFlowSink) { // Create the annotation HttpFlowSecurerAnnotation annotation = new HttpFlowSecurerAnnotation( this.httpSecurerBuilder.getHttpSecurityName(), this.httpSecurerBuilder.getAnyRoles(), this.httpSecurerBuilder.getRequiredRoles(), argumentType); // Configure the function String functionName = HttpSecurityArchitectEmployer.this.nextUniqueName(); SectionFunctionNamespace namespace = designer.addSectionFunctionNamespace(functionName, new HttpFlowSecurerManagedFunctionSource(annotation)); SectionFunction function = namespace.addSectionFunction(functionName, HttpFlowSecurerManagedFunctionSource.FUNCTION_NAME); // Configure the function designer.link(function.getFunctionFlow(Flows.SECURE.name()), secureFlowSink, false); designer.link(function.getFunctionFlow(Flows.INSECURE.name()), insecureFlowSink, false); // Return the decision flow sink return function; } }
SectionFunctionNamespace initialNamespace = designer.addSectionFunctionNamespace("INITIAL", new WebTemplateInitialManagedFunctionSource(initialFunctionFactory)); SectionFunction initialFunction = initialNamespace.addSectionFunction("_INITIAL_FUNCTION_", SectionFunctionNamespace templateNamespace = designer.addSectionFunctionNamespace(TEMPLATE_NAMESPACE_NANE, new WebTemplateManagedFunctionSource(isTemplateSecure, template, templateCharset, linkSeparatorCharacter)); SectionFunctionNamespace arrayIteratorNamespace = designer.addSectionFunctionNamespace( templateFunctionName + "ArrayIterator", new WebTemplateArrayIteratorManagedFunctionSource(beanType)); .addSectionFunctionNamespace("", new WebTemplateArrayIteratorCompletionManagedObjectSource()) .addSectionFunction("_complete_array_iteration_", WebTemplateArrayIteratorCompletionManagedObjectSource.FUNCTION_NAME);
@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); } }
SectionFunctionNamespace namespace = designer.addSectionFunctionNamespace("HttpSecuritySource", new HttpSecurityManagedFunctionSource(security, securityType));
SectionFunctionNamespace routeNamespace = designer.addSectionFunctionNamespace("ROUTE", new HttpRouteManagedFunctionSource(httpRouter)); SectionFunction route = routeNamespace.addSectionFunction(WebArchitect.HANDLER_INPUT_NAME, ROUTE_FUNCTION_NAME); SectionFunctionNamespace handleRedirectNamespace = designer.addSectionFunctionNamespace("REDIRECT", new HttpHandleRedirectFunctionSource(httpRouter)); SectionFunction handleRedirect = handleRedirectNamespace.addSectionFunction(HANDLE_REDIRECT_FUNCTION_NAME, SectionFunctionNamespace interceptNamespace = designer.addSectionFunctionNamespace( InterceptManagedFunctionSource.FUNCTION_NAME, new InterceptManagedFunctionSource()); SectionFunction intercept = interceptNamespace.addSectionFunction( SectionFunctionNamespace initialiseNamespace = designer.addSectionFunctionNamespace(outputName, new InitialiseHttpRequestStateManagedFunctionSource()); SectionFunction initialise = initialiseNamespace.addSectionFunction(outputName, SectionFunctionNamespace notFoundNamespace = designer.addSectionFunctionNamespace("NOT_FOUND", new NotFoundManagedFunctionSource()); SectionFunction notFound = notFoundNamespace.addSectionFunction(NOT_FOUND_INPUT_NAME, NOT_FOUND_INPUT_NAME); SectionFunctionNamespace redirectNamespace = designer.addSectionFunctionNamespace(functionName, new RedirectManagedFunctionSource(redirect)); SectionFunction redirection = redirectNamespace.addSectionFunction(functionName, functionName);