Examples of ConstraintMapping


Examples of org.eclipse.jetty.security.ConstraintMapping

    private SecurityHandler getSecurityHandler() throws IOException {
        Constraint constraint = new Constraint(Constraint.__BASIC_AUTH, "user");
        constraint.setAuthenticate(true);

        ConstraintMapping cm = new ConstraintMapping();
        cm.setPathSpec("/*");
        cm.setConstraint(constraint);

        ConstraintSecurityHandler sh = new ConstraintSecurityHandler();
        sh.setAuthenticator(new BasicAuthenticator());
        sh.setConstraintMappings(Arrays.asList(new ConstraintMapping[] {cm}));

View Full Code Here

Examples of org.eclipse.jetty.security.ConstraintMapping

      logger.info(String.format("Configuring automatic http(%1$s) -> https(%2$s) redirects", params.port, params.securePort));
      // Create the internal mechanisms to handle secure connections and redirects
      Constraint constraint = new Constraint();
      constraint.setDataConstraint(Constraint.DC_CONFIDENTIAL);

      ConstraintMapping cm = new ConstraintMapping();
      cm.setConstraint(constraint);
      cm.setPathSpec("/*");

      ConstraintSecurityHandler sh = new ConstraintSecurityHandler();
      sh.setConstraintMappings(new ConstraintMapping[] { cm });

      // Configure this context to use the Security Handler defined before
View Full Code Here

Examples of org.eclipse.jetty.security.ConstraintMapping

    private SecurityHandler getSecurityHandler() throws IOException {
        Constraint constraint = new Constraint(Constraint.__BASIC_AUTH, "user");
        constraint.setAuthenticate(true);

        ConstraintMapping cm = new ConstraintMapping();
        cm.setPathSpec("/*");
        cm.setConstraint(constraint);

        ConstraintSecurityHandler sh = new ConstraintSecurityHandler();
        sh.setAuthenticator(new BasicAuthenticator());
        sh.setConstraintMappings(Arrays.asList(new ConstraintMapping[] {cm}));

View Full Code Here

Examples of org.eclipse.jetty.security.ConstraintMapping

    private SecurityHandler getSecurityHandler() throws IOException {
        Constraint constraint = new Constraint(Constraint.__BASIC_AUTH, "user");
        constraint.setAuthenticate(true);

        ConstraintMapping cm = new ConstraintMapping();
        cm.setPathSpec("/*");
        cm.setConstraint(constraint);

        ConstraintSecurityHandler sh = new ConstraintSecurityHandler();
        sh.setAuthenticator(new BasicAuthenticator());
        sh.setConstraintMappings(Arrays.asList(new ConstraintMapping[] {cm}));

View Full Code Here

Examples of org.eclipse.jetty.security.ConstraintMapping

    private SecurityHandler getSecurityHandler() throws IOException {
        Constraint constraint = new Constraint(Constraint.__BASIC_AUTH, "user");
        constraint.setAuthenticate(true);

        ConstraintMapping cm = new ConstraintMapping();
        cm.setPathSpec("/*");
        cm.setConstraint(constraint);

        ConstraintSecurityHandler sh = new ConstraintSecurityHandler();
        sh.setAuthenticator(new BasicAuthenticator());
        sh.setConstraintMappings(Arrays.asList(new ConstraintMapping[] {cm}));
       
View Full Code Here

Examples of org.eclipse.jetty.security.ConstraintMapping

      logger.info(String.format("Configuring automatic http(%1$s) -> https(%2$s) redirects", params.port, params.securePort));
      // Create the internal mechanisms to handle secure connections and redirects
      Constraint constraint = new Constraint();
      constraint.setDataConstraint(Constraint.DC_CONFIDENTIAL);

      ConstraintMapping cm = new ConstraintMapping();
      cm.setConstraint(constraint);
      cm.setPathSpec("/*");

      ConstraintSecurityHandler sh = new ConstraintSecurityHandler();
      sh.setConstraintMappings(new ConstraintMapping[] { cm });

      // Configure this context to use the Security Handler defined before
View Full Code Here

Examples of org.hibernate.validator.cfg.ConstraintMapping

    private ValidatorFactory initFactory() {
        final ClassLoader oldTCCL = SecurityActions.getContextClassLoader();
        try {
            SecurityActions.setContextClassLoader(classLoader);
            if (configuration == null) {
                ConstraintMapping mapping = new ConstraintMapping();
                HibernateValidatorConfiguration config = Validation.byProvider(HibernateValidator.class).providerResolver(new JbossProviderResolver()).configure();
                config.addMapping(mapping);
                ValidatorFactory factory = config.buildValidatorFactory();
                return factory;
View Full Code Here

Examples of org.hibernate.validator.cfg.ConstraintMapping

    private ValidatorFactory initFactory() {
        final ClassLoader oldTCCL = SecurityActions.getContextClassLoader();
        try {
            SecurityActions.setContextClassLoader(oldTCCL);
            ConstraintMapping mapping = new ConstraintMapping();
            HibernateValidatorConfiguration config = Validation.byProvider(HibernateValidator.class).providerResolver(new JbossProviderResolver()).configure();
            config.addMapping(mapping);
            ValidatorFactory factory = config.buildValidatorFactory();
            return factory;
        } finally {
View Full Code Here

Examples of org.hibernate.validator.cfg.ConstraintMapping

    @Test
    public void testCustomMessageInterpolation() {

        HibernateValidatorConfiguration configuration = Validation.byProvider(HibernateValidator.class).configure();
        Assert.assertNotNull(configuration);
        ConstraintMapping mapping = new ConstraintMapping();
        mapping.type(Employee.class).property("firstName", FIELD)
                .constraint(new EmailDef().message("Invalid Email!You have entered:--\\{${validatedValue}\\}"));

        final MessageInterpolator messageInterpolator = new ValueFormatterMessageInterpolator();
        configuration.messageInterpolator(messageInterpolator);
        configuration.addMapping(mapping);
View Full Code Here

Examples of org.hibernate.validator.cfg.ConstraintMapping

    private ValidatorFactory initFactory() {
        final ClassLoader oldTCCL = SecurityActions.getContextClassLoader();
        try {
            SecurityActions.setContextClassLoader(oldTCCL);
            if (configuration == null) {
                ConstraintMapping mapping = new ConstraintMapping();
                HibernateValidatorConfiguration config = Validation.byProvider(HibernateValidator.class).providerResolver(new JbossProviderResolver()).configure();
                config.addMapping(mapping);
                ValidatorFactory factory = config.buildValidatorFactory();
                return factory;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.