All Downloads are FREE. Search and download functionalities are using the official Maven repository.

restx.security.SecurityFactoryFactoryMachine Maven / Gradle / Ivy

There is a newer version: 1.2.0-rc2
Show newest version
package restx.security;

import com.google.common.collect.ImmutableSet;
import restx.factory.*;
import restx.security.SecurityFactory;


@Machine
public class SecurityFactoryFactoryMachine extends DefaultFactoryMachine {
    private static final SecurityFactory module = new SecurityFactory();

    public SecurityFactoryFactoryMachine() {
        super(1000, new MachineEngine[] {
            new StdMachineEngine(Name.of(restx.security.RestxSessionCookieDescriptor.class, "restxSessionCookieDescriptor"), 1000, BoundlessComponentBox.FACTORY) {
        private final Factory.Query appName = Factory.Query.byName(Name.of(java.lang.String.class, "app.name")).optional();
private final Factory.Query restxConfig = Factory.Query.byClass(restx.common.RestxConfig.class).mandatory();
                @Override
                public BillOfMaterials getBillOfMaterial() {
                    return new BillOfMaterials(ImmutableSet.>of(
        appName,
restxConfig
                    ));
                }

                @Override
                public restx.security.RestxSessionCookieDescriptor doNewComponent(SatisfiedBOM satisfiedBOM) {
	                    return module.restxSessionCookieDescriptor(
	        satisfiedBOM.getOneAsComponent(appName),
satisfiedBOM.getOne(restxConfig).get().getComponent()
	                    );
                }
            },

        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy