/** * Instantiate. * * @param securityName {@link HttpSecurity} name. * @param properties {@link PropertyList}. */ private HttpSecurityBuilderImpl(String securityName, HttpSecuritySource<A, AC, C, O, F> securitySource, PropertyList properties) { this.name = securityName; this.source = securitySource; this.properties = properties; // Create the section for the HTTP Security this.section = HttpSecurityArchitectEmployer.this.officeArchitect .addOfficeSection(securityName + "_HttpSecurity", new HttpSecuritySectionSource<>(this), null); }
@Override protected WebTemplate addTemplate(boolean isSecure, String applicationPath, PropertyList properties) { // Add the section for the template WebTemplateSectionSource webTemplateSectionSource = new WebTemplateSectionSource(); OfficeSection templateSection = this.officeArchitect.addOfficeSection(applicationPath, webTemplateSectionSource, applicationPath); // Add the template WebTemplateImpl template = new WebTemplateImpl(isSecure, applicationPath, webTemplateSectionSource, templateSection, properties); this.templates.add(template); // Return the template return template; }
this.officeSourceContext = officeSourceContext; this.routing = new HttpRouteSectionSource(this.contextPath); this.routingSection = this.officeArchitect.addOfficeSection(HANDLER_SECTION_NAME, this.routing, null);
/** * Instantiate. * * @param woof {@link WoofModel}. * @param officeArchitect {@link OfficeArchitect}. */ private SectionConnector(WoofModel woof, OfficeArchitect officeArchitect) { this.officeArchitect = officeArchitect; // Configure the sections for (WoofSectionModel sectionModel : woof.getWoofSections()) { // Obtain the section details String sectionName = sectionModel.getWoofSectionName(); String sectionSourceClassName = sectionModel.getSectionSourceClassName(); String sectionLocation = sectionModel.getSectionLocation(); // Configure the section OfficeSection section = officeArchitect.addOfficeSection(sectionName, sectionSourceClassName, sectionLocation); for (PropertyModel property : sectionModel.getProperties()) { section.addProperty(property.getName(), property.getValue()); } // Maintain reference to section by name this.sections.put(sectionName, section); // Maintain references from inputs to section for (WoofSectionInputModel inputModel : sectionModel.getInputs()) { this.inputToSection.put(inputModel, sectionModel); } } }
OfficeSection handleAuthenticationRequiredSection = this.officeArchitect.addOfficeSection( "AuthenticationRequiredHandler", new HandleAuthenticationRequiredSectionSource(httpSecurityNames, negotiator), null);
@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); } });