Package org.apache.marmotta.platform.security.model

Examples of org.apache.marmotta.platform.security.model.SecurityConstraint


                    int priority = configurationService.getIntConfiguration(keyPrefix+".priority",1);
                    List<String> methods = configurationService.getListConfiguration(keyPrefix + ".methods");
                    List<String> hosts = configurationService.getListConfiguration(keyPrefix + ".host");
                    List<String> roles = configurationService.getListConfiguration(keyPrefix + ".roles");

                    SecurityConstraint constraint =
                            new SecurityConstraint(SecurityConstraint.Type.valueOf(type.toUpperCase()),
                                    configName,
                                    pattern,
                                    enabled,
                                    priority);
                    constraint.getRoles().addAll(roles);

                    for(String method : methods) {
                        constraint.getMethods().add(parse(method));
                    }

                    constraint.setHostPatterns(parseHostAddresses(hosts));
                    constraints.add(constraint);

                }
            }

            Collections.sort(constraints);

            if(log.isInfoEnabled()) {
                log.info("The following security constraints have been configured:");
                for(SecurityConstraint constraint : constraints) {
                    log.info("-- {}",constraint.toString());
                }

            }
        }
    }
View Full Code Here


    @Path("/constraints/{name}")
    @GET
    @Produces("application/json")
    public Response getConstraint(@PathParam("name") String name) {
        SecurityConstraint constraint = null;
        for(SecurityConstraint constraint1 : securityService.listSecurityConstraints()) {
            if(constraint1.getName().equals(name)) {
                constraint = constraint1;
                break;
            }
View Full Code Here

TOP

Related Classes of org.apache.marmotta.platform.security.model.SecurityConstraint

Copyright © 2018 www.massapicom. 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.