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

restx.security.DefaultCookieSignerFactoryMachine 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.DefaultCookieSigner;

@Machine
public class DefaultCookieSignerFactoryMachine extends SingleNameFactoryMachine {
    public static final Name NAME = Name.of(restx.security.DefaultCookieSigner.class, "CookieSigner");

    public DefaultCookieSignerFactoryMachine() {
        super(0, new StdMachineEngine(NAME, 0, BoundlessComponentBox.FACTORY) {
private final Factory.Query signatureKey = Factory.Query.byClass(restx.security.SignatureKey.class).optional();

            @Override
            public BillOfMaterials getBillOfMaterial() {
                return new BillOfMaterials(ImmutableSet.>of(
signatureKey
                ));
            }

            @Override
            protected restx.security.DefaultCookieSigner doNewComponent(SatisfiedBOM satisfiedBOM) {
                return new DefaultCookieSigner(
satisfiedBOM.getOneAsComponent(signatureKey)
                );
            }
        });
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy