@Override public OfficeSectionInput getAuthenticateInput() { return this.section.getOfficeSectionInput(HttpSecuritySectionSource.INPUT_AUTHENTICATE); }
@Override public void reroute(OfficeFlowSourceNode flowSourceNode) { this.officeArchitect.link(flowSourceNode, this.routingSection.getOfficeSectionInput(HANDLER_INPUT_NAME)); }
/** * Link to {@link OfficeSectionInput}. * * @param flowSourceFactory {@link Supplier} of the * {@link OfficeFlowSourceNode}. * @param connectionModel {@link ConnectionModel} to * {@link OfficeSectionInputModel}. * @param sectionInputFactory Factory to extract {@link OfficeSectionInputModel} * from {@link ConnectionModel}. */ private <C extends ConnectionModel> void linkToSectionInput(Supplier<OfficeFlowSourceNode> flowSourceFactory, C connectionModel, Function<C, WoofSectionInputModel> sectionInputFactory) { // Determine if linking if (connectionModel != null) { WoofSectionInputModel sectionInput = sectionInputFactory.apply(connectionModel); if (sectionInput != null) { // Obtain target input name String targetInputName = sectionInput.getWoofSectionInputName(); // Obtain the target section WoofSectionModel sectionModel = this.inputToSection.get(sectionInput); OfficeSection targetSection = this.sections.get(sectionModel.getWoofSectionName()); // Link the flow to the section input this.officeArchitect.link(flowSourceFactory.get(), targetSection.getOfficeSectionInput(targetInputName)); } } } }
@Override public HttpInput link(boolean isSecure, String httpMethodName, String applicationPath, Class<?> sectionClass) { // Add the section OfficeSection section = this.addSection(httpMethodName + "_" + applicationPath, sectionClass); // Create the link to the section service method HttpInput input = this.webArchitect.getHttpInput(isSecure, httpMethodName, applicationPath); this.officeArchitect.link(input.getInput(), section.getOfficeSectionInput("service")); return input; }
@Override public HttpUrlContinuation link(boolean isSecure, String applicationPath, Class<?> sectionClass) { // Add the section OfficeSection section = this.addSection("GET_" + applicationPath, sectionClass); // Return the link to the section service method HttpUrlContinuation continuation = this.webArchitect.getHttpInput(isSecure, applicationPath); this.officeArchitect.link(continuation.getInput(), section.getOfficeSectionInput("service")); return continuation; } }
/** * Instantiate. * * @param isSecure * Indicates if requires secure {@link ServerHttpConnection} to * render the {@link WebTemplate}. * @param applicationPath * Application path for the {@link WebTemplate}. * @param webTemplateSectionSource * {@link WebTemplateSectionSource}. * @param templateSection * {@link OfficeSection} for the {@link WebTemplate}. * @param properties * {@link PropertyList}. */ private WebTemplateImpl(boolean isSecure, String applicationPath, WebTemplateSectionSource webTemplateSectionSource, OfficeSection templateSection, PropertyList properties) { super(webTemplateSectionSource, isSecure, applicationPath, properties, WebTemplateArchitectEmployer.this.officeArchitect); this.section = templateSection; // Configure the input this.sectionInput = this.section.getOfficeSectionInput(WebTemplateSectionSource.RENDER_TEMPLATE_INPUT_NAME); this.templateInput = WebTemplateArchitectEmployer.this.webArchitect.getHttpInput(isSecure, applicationPath); WebTemplateArchitectEmployer.this.officeArchitect.link(this.templateInput.getInput(), this.sectionInput); }
@Override public OfficeFlowSinkNode getRedirect(String parameterTypeName) { // Obtain the parameter type class Class<?> parameterType = CompileUtil.isBlank(parameterTypeName) ? Object.class : WebArchitectEmployer.this.officeSourceContext.loadClass(parameterTypeName); // Determine if already cached OfficeFlowSinkNode flowSinkNode = this.redirects.get(parameterTypeName); if (flowSinkNode != null) { return flowSinkNode; } // Not cached, so create try { // Create the redirect Redirect redirect = WebArchitectEmployer.this.routing.addRedirect(this.isSecure, this.routeInput, parameterType); // Obtain and cache the flow sink node for the redirect flowSinkNode = WebArchitectEmployer.this.routingSection.getOfficeSectionInput(redirect.getInputName()); this.redirects.put(parameterTypeName, flowSinkNode); // Return the section input for redirect return flowSinkNode; } catch (Exception ex) { throw WebArchitectEmployer.this.officeArchitect.addIssue("Failed to create redirect to " + this.applicationPath + (parameterTypeName == null ? " with null value type" : " with values type " + parameterTypeName), ex); } } }
httpChallengeContext); this.officeArchitect.link(authenticationRequiredEscalation, handleAuthenticationRequiredSection .getOfficeSectionInput(HandleAuthenticationRequiredSectionSource.HANDLE_INPUT)); for (HttpSecurityBuilderImpl<?, ?, ?, ?, ?> security : this.securities) { this.officeArchitect.link(handleAuthenticationRequiredSection.getOfficeSectionOutput(security.name), security.section.getOfficeSectionInput(HttpSecuritySectionSource.INPUT_CHALLENGE));
@Override public OfficeFlowSinkNode secureFlow(Class<?> argumentType, OfficeFlowSinkNode secureFlowSink, OfficeFlowSinkNode insecureFlowSink) { // Obtain the office architect OfficeArchitect office = HttpSecurityArchitectEmployer.this.officeArchitect; // Create the section to handle access logic String sectionName = HttpSecurityArchitectEmployer.this.nextUniqueName(); OfficeSection section = office.addOfficeSection(sectionName, new HttpFlowSecurerSectionSource( new HttpFlowSecurerAnnotation(qualifier, anyRoles, allRoles, argumentType)), null); // Link office.link(section.getOfficeSectionOutput(HttpFlowSecurerSectionSource.SECURE_OUTPUT_NAME), secureFlowSink); office.link(section.getOfficeSectionOutput(HttpFlowSecurerSectionSource.INSECURE_OUTPUT_NAME), insecureFlowSink); // Return the sink to secure flow decision return section.getOfficeSectionInput(HttpFlowSecurerSectionSource.INPUT_NAME); } });
OfficeSectionInput linkInput = this.section.getOfficeSectionInput(linkName);
authenticationContextMos.setTimeout(this.timeout); office.link(authenticationContextMos.getOfficeManagedObjectFlow("AUTHENTICATE"), this.section.getOfficeSectionInput("ManagedObjectAuthenticate")); office.link(authenticationContextMos.getOfficeManagedObjectFlow("LOGOUT"), this.section.getOfficeSectionInput("ManagedObjectLogout")); OfficeManagedObject authenticationContext = authenticationContextMos .addOfficeManagedObject(authenticationContextName, ManagedObjectScope.PROCESS);
OfficeSectionInput routingInput = this.routingSection.getOfficeSectionInput(interception.getInputName()); this.officeArchitect.link(interceptionOutput, routingInput); this.routingSection.getOfficeSectionInput(HttpRouteSectionSource.NOT_FOUND_INPUT_NAME));
architect.getOfficeSection(flow.getSection()).getOfficeSectionInput(flow.getInput()));