@Override public void reroute(OfficeFlowSourceNode flowSourceNode) { this.officeArchitect.link(flowSourceNode, this.routingSection.getOfficeSectionInput(HANDLER_INPUT_NAME)); }
/** * Link to {@link WoofResourceModel}. * * @param flowSourceFactory {@link Supplier} of the * {@link OfficeFlowSourceNode}. * @param connectionModel {@link ConnectionModel} to * {@link WoofResourceModel}. * @param resourceFactory Factory to extract {@link WoofResourceModel} from * {@link ConnectionModel}. */ private <C extends ConnectionModel> void linkToResource(Supplier<OfficeFlowSourceNode> flowSourceFactory, C connectionModel, Function<C, WoofResourceModel> resourceFactory) { // Determine if linking if (connectionModel != null) { WoofResourceModel resource = resourceFactory.apply(connectionModel); if (resource != null) { // Obtain the target resource OfficeFlowSinkNode targetResource = this.resources.get(resource.getResourcePath()); // Link the flow to the resource this.officeArchitect.link(flowSourceFactory.get(), targetResource); } } } }
/** * Link to {@link WoofSecurityModel}. * * @param flowSourceFactory {@link Supplier} of the * {@link OfficeFlowSourceNode}. * @param connectionModel {@link ConnectionModel} to * {@link WoofSecurityModel}. * @param securityFactory Factory to extract {@link WoofSecurityModel} from * {@link ConnectionModel}. */ private <C extends ConnectionModel> void linkToSecurity(Supplier<OfficeFlowSourceNode> flowSourceFactory, C connectionModel, Function<C, WoofSecurityModel> securityFactory) { // Determine if linking if (connectionModel != null) { WoofSecurityModel security = securityFactory.apply(connectionModel); if (security != null) { // Obtain the target security HttpSecurityBuilder targetSecurity = this.securityBuilders.get(security.getHttpSecurityName()); // Link the flow to the security this.officeArchitect.link(flowSourceFactory.get(), targetSecurity.getAuthenticateInput()); } } } }
/** * Link to {@link WoofTemplateModel}. * * @param flowSourceFactory {@link Supplier} of the * {@link OfficeFlowSourceNode}. * @param connectionModel {@link ConnectionModel} to * {@link WoofTemplateModel}. * @param templateFactory Factory to extract {@link WoofTemplateModel} from * {@link ConnectionModel}. * @param valuesType Values type. */ private <C extends ConnectionModel> void linkToTemplate(Supplier<OfficeFlowSourceNode> flowSourceFactory, C connectionModel, Function<C, WoofTemplateModel> templateFactory, String valuesType) { // Determine if linking if (connectionModel != null) { WoofTemplateModel template = templateFactory.apply(connectionModel); if (template != null) { // Obtain the target template WebTemplate targetTemplate = this.templates.get(template.getApplicationPath()); // Link the flow to the template this.officeArchitect.link(flowSourceFactory.get(), targetTemplate.getRender(valuesType)); } } } }
/** * Link to {@link WoofHttpContinuationModel}. * * @param flowSourceFactory {@link Supplier} of the * {@link OfficeFlowSourceNode}. * @param connectionModel {@link ConnectionModel} to * {@link WoofHttpContinuationModel}. * @param continuationFactory Factory to extract {@link WoofTemplateModel} from * {@link ConnectionModel}. * @param parameterType Parameter type. */ private <C extends ConnectionModel> void linkToHttpContinuation( Supplier<OfficeFlowSourceNode> flowSourceFactory, C connectionModel, Function<C, WoofHttpContinuationModel> continuationFactory, String parameterType) { // Determine if linking if (connectionModel != null) { WoofHttpContinuationModel httpContinuation = continuationFactory.apply(connectionModel); if (httpContinuation != null) { // Obtain the target continuation HttpUrlContinuation targetContinuation = this.httpContinuations .get(httpContinuation.getApplicationPath()); // Link the flow to the continuation this.officeArchitect.link(flowSourceFactory.get(), targetContinuation.getRedirect(parameterType)); } } } }
/** * 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 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; } }
@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; }
/** * 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 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); } });
architect.link(mos, architect.addManagedObjectPool("POOL", ThreadLocalJdbcConnectionPoolSource.class.getName()));
OfficeManagedObjectPool pool = context.getOfficeArchitect().addManagedObjectPool("POOL", ThreadLocalJdbcConnectionPoolSource.class.getName()); context.getOfficeArchitect().link(mos, pool);
OfficeManagedObjectPool pool = context.getOfficeArchitect().addManagedObjectPool("POOL", ThreadLocalJdbcConnectionPoolSource.class.getName()); context.getOfficeArchitect().link(mos, pool);
architect.link(mos, architect.addManagedObjectPool("POOL", ThreadLocalJdbcConnectionPoolSource.class.getName()));
new AuthenticationContextManagedObjectSource<>(this.name, this.security)); 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 OfficeManagedObject authentication = authenticationMos.addOfficeManagedObject(authenticationName, ManagedObjectScope.PROCESS); office.link(authentication.getOfficeManagedObjectDependency("AUTHENTICATION_CONTEXT"), authenticationContext); this.httpAuthentication = httpAuthenticationMos.addOfficeManagedObject(httpAuthenticationName, ManagedObjectScope.PROCESS); office.link(this.httpAuthentication.getOfficeManagedObjectDependency("AUTHENTICATION"), authentication); office.link(accessControl.getOfficeManagedObjectDependency("AUTHENTICATION_CONTEXT"), authenticationContext); this.httpAccessControl = httpAccessControlMos.addOfficeManagedObject(httpAccessControlName, ManagedObjectScope.PROCESS); office.link(httpAccessControl.getOfficeManagedObjectDependency("ACCESS_CONTROL"), accessControl); if (isRequireTypeQualification) { httpAccessControl.addTypeQualification(this.name, HttpAccessControl.class.getName()); office.link(this.section.getOfficeSectionObject(AuthenticationContext.class.getSimpleName()), authenticationContext); office.link(this.section.getOfficeSectionObject("AccessControl"), accessControl);
WebTemplateArchitectEmployer.this.officeArchitect.link( WebTemplateArchitectEmployer.this.webArchitect .getHttpInput(this.isSecure, httpMethodName, this.applicationPath).getInput(), WebTemplateArchitectEmployer.this.officeArchitect.link( WebTemplateArchitectEmployer.this.webArchitect .getHttpInput(isLinkSecure, httpMethodName, linkPath).getInput(), WebTemplateArchitectEmployer.this.officeArchitect.link(redirectOutput, this.templateInput.getRedirect(valuesType == null ? null : valuesType.getName()));
architect.link(mos, architect.addManagedObjectPool("POOL", ThreadLocalJdbcConnectionPoolSource.class.getName()));
context.getOfficeArchitect().link(mos, pool); }); OfficeFloor officeFloor = compiler.compileAndOpenOfficeFloor();
OfficeManagedObjectPool pool = context.getOfficeArchitect().addManagedObjectPool("POOL", ThreadLocalJdbcConnectionPoolSource.class.getName()); context.getOfficeArchitect().link(connectionMos, pool);