Package org.jboss.metadata.web.spec

Examples of org.jboss.metadata.web.spec.ServletSecurityMetaData


                      wrapper.setMultipartConfig(multipartConfig);
                   }
                   // Merge @ServletSecurity
                   if (annotation.getServletSecurity() != null && wrapper.getServletSecurity() == null)
                   {
                      ServletSecurityMetaData servletSecurityAnnotation = annotation.getServletSecurity();
                      Collection<HttpMethodConstraintElement> methodConstraints = null;
                     
                      EmptyRoleSemantic emptyRoleSemantic =  EmptyRoleSemantic.PERMIT;
                      if (servletSecurityAnnotation.getEmptyRoleSemantic() != null)
                      {
                         emptyRoleSemantic = EmptyRoleSemantic.valueOf(servletSecurityAnnotation.getEmptyRoleSemantic().toString());
                      }
                      TransportGuarantee transportGuarantee = TransportGuarantee.NONE;
                      if (servletSecurityAnnotation.getTransportGuarantee() != null)
                      {
                         transportGuarantee = TransportGuarantee.valueOf(servletSecurityAnnotation.getTransportGuarantee().toString());
                      }
                      String[] roleNames = servletSecurityAnnotation.getRolesAllowed().toArray(new String[0]);
                      HttpConstraintElement constraint = new HttpConstraintElement(emptyRoleSemantic, transportGuarantee, roleNames);
                     
                      if (servletSecurityAnnotation.getHttpMethodConstraints() != null)
                      {
                         methodConstraints = new HashSet<HttpMethodConstraintElement>();
                         for (HttpMethodConstraintMetaData annotationMethodConstraint :
                            servletSecurityAnnotation.getHttpMethodConstraints())
                         {
                            emptyRoleSemantic =  EmptyRoleSemantic.PERMIT;
                            if (annotationMethodConstraint.getEmptyRoleSemantic() != null)
                            {
                               emptyRoleSemantic = EmptyRoleSemantic.valueOf(annotationMethodConstraint.getEmptyRoleSemantic().toString());
View Full Code Here


                            multipartConfig.setFileSizeThreshold(multipartConfigMetaData.getFileSizeThreshold());
                            wrapper.setMultipartConfig(multipartConfig);
                        }
                        // Merge @ServletSecurity
                        if (annotation.getServletSecurity() != null && wrapper.getServletSecurity() == null) {
                            ServletSecurityMetaData servletSecurityAnnotation = annotation.getServletSecurity();
                            Collection<HttpMethodConstraintElement> methodConstraints = null;

                            EmptyRoleSemantic emptyRoleSemantic = EmptyRoleSemantic.PERMIT;
                            if (servletSecurityAnnotation.getEmptyRoleSemantic() != null) {
                                emptyRoleSemantic = EmptyRoleSemantic.valueOf(servletSecurityAnnotation.getEmptyRoleSemantic()
                                        .toString());
                            }
                            TransportGuarantee transportGuarantee = TransportGuarantee.NONE;
                            if (servletSecurityAnnotation.getTransportGuarantee() != null) {
                                transportGuarantee = TransportGuarantee.valueOf(servletSecurityAnnotation
                                        .getTransportGuarantee().toString());
                            }
                            String[] roleNames = servletSecurityAnnotation.getRolesAllowed().toArray(new String[0]);
                            HttpConstraintElement constraint = new HttpConstraintElement(emptyRoleSemantic, transportGuarantee,
                                    roleNames);

                            if (servletSecurityAnnotation.getHttpMethodConstraints() != null) {
                                methodConstraints = new HashSet<HttpMethodConstraintElement>();
                                for (HttpMethodConstraintMetaData annotationMethodConstraint : servletSecurityAnnotation
                                        .getHttpMethodConstraints()) {
                                    emptyRoleSemantic = EmptyRoleSemantic.PERMIT;
                                    if (annotationMethodConstraint.getEmptyRoleSemantic() != null) {
                                        emptyRoleSemantic = EmptyRoleSemantic.valueOf(annotationMethodConstraint
                                                .getEmptyRoleSemantic().toString());
View Full Code Here

                            multipartConfig.setFileSizeThreshold(multipartConfigMetaData.getFileSizeThreshold());
                            wrapper.setMultipartConfig(multipartConfig);
                        }
                        // Merge @ServletSecurity
                        if (annotation.getServletSecurity() != null && wrapper.getServletSecurity() == null) {
                            ServletSecurityMetaData servletSecurityAnnotation = annotation.getServletSecurity();
                            Collection<HttpMethodConstraintElement> methodConstraints = null;

                            EmptyRoleSemantic emptyRoleSemantic = EmptyRoleSemantic.PERMIT;
                            if (servletSecurityAnnotation.getEmptyRoleSemantic() != null) {
                                emptyRoleSemantic = EmptyRoleSemantic.valueOf(servletSecurityAnnotation.getEmptyRoleSemantic()
                                        .toString());
                            }
                            TransportGuarantee transportGuarantee = TransportGuarantee.NONE;
                            if (servletSecurityAnnotation.getTransportGuarantee() != null) {
                                transportGuarantee = TransportGuarantee.valueOf(servletSecurityAnnotation
                                        .getTransportGuarantee().toString());
                            }
                            String[] roleNames = servletSecurityAnnotation.getRolesAllowed().toArray(new String[0]);
                            HttpConstraintElement constraint = new HttpConstraintElement(emptyRoleSemantic, transportGuarantee,
                                    roleNames);

                            if (servletSecurityAnnotation.getHttpMethodConstraints() != null) {
                                methodConstraints = new HashSet<HttpMethodConstraintElement>();
                                for (HttpMethodConstraintMetaData annotationMethodConstraint : servletSecurityAnnotation
                                        .getHttpMethodConstraints()) {
                                    emptyRoleSemantic = EmptyRoleSemantic.PERMIT;
                                    if (annotationMethodConstraint.getEmptyRoleSemantic() != null) {
                                        emptyRoleSemantic = EmptyRoleSemantic.valueOf(annotationMethodConstraint
                                                .getEmptyRoleSemantic().toString());
View Full Code Here

                            multipartConfig.setFileSizeThreshold(multipartConfigMetaData.getFileSizeThreshold());
                            wrapper.setMultipartConfig(multipartConfig);
                        }
                        // Merge @ServletSecurity
                        if (annotation.getServletSecurity() != null && wrapper.getServletSecurity() == null) {
                            ServletSecurityMetaData servletSecurityAnnotation = annotation.getServletSecurity();
                            Collection<HttpMethodConstraintElement> methodConstraints = null;

                            EmptyRoleSemantic emptyRoleSemantic = EmptyRoleSemantic.PERMIT;
                            if (servletSecurityAnnotation.getEmptyRoleSemantic() != null) {
                                emptyRoleSemantic = EmptyRoleSemantic.valueOf(servletSecurityAnnotation.getEmptyRoleSemantic()
                                        .toString());
                            }
                            TransportGuarantee transportGuarantee = TransportGuarantee.NONE;
                            if (servletSecurityAnnotation.getTransportGuarantee() != null) {
                                transportGuarantee = TransportGuarantee.valueOf(servletSecurityAnnotation
                                        .getTransportGuarantee().toString());
                            }
                            String[] roleNames = servletSecurityAnnotation.getRolesAllowed().toArray(new String[0]);
                            HttpConstraintElement constraint = new HttpConstraintElement(emptyRoleSemantic, transportGuarantee,
                                    roleNames);

                            if (servletSecurityAnnotation.getHttpMethodConstraints() != null) {
                                methodConstraints = new HashSet<HttpMethodConstraintElement>();
                                for (HttpMethodConstraintMetaData annotationMethodConstraint : servletSecurityAnnotation
                                        .getHttpMethodConstraints()) {
                                    emptyRoleSemantic = EmptyRoleSemantic.PERMIT;
                                    if (annotationMethodConstraint.getEmptyRoleSemantic() != null) {
                                        emptyRoleSemantic = EmptyRoleSemantic.valueOf(annotationMethodConstraint
                                                .getEmptyRoleSemantic().toString());
View Full Code Here

                if (annotationMD == null) {
                    annotationMD = new AnnotationMetaData();
                    annotationMD.setClassName(classInfo.toString());
                    annotations.add(annotationMD);
                }
                ServletSecurityMetaData servletSecurity = new ServletSecurityMetaData();
                AnnotationValue httpConstraintValue = annotation.value();
                List<String> rolesAllowed = new ArrayList<String>();
                if (httpConstraintValue != null) {
                    AnnotationInstance httpConstraint = httpConstraintValue.asNested();
                    AnnotationValue httpConstraintERSValue = httpConstraint.value();
                    if (httpConstraintERSValue != null) {
                        servletSecurity.setEmptyRoleSemantic(EmptyRoleSemanticType.valueOf(httpConstraintERSValue.asEnum()));
                    }
                    AnnotationValue httpConstraintTGValue = httpConstraint.value("transportGuarantee");
                    if (httpConstraintTGValue != null) {
                        servletSecurity.setTransportGuarantee(TransportGuaranteeType.valueOf(httpConstraintTGValue.asEnum()));
                    }
                    AnnotationValue rolesAllowedValue = httpConstraint.value("rolesAllowed");
                    if (rolesAllowedValue != null) {
                        for (String role : rolesAllowedValue.asStringArray()) {
                            rolesAllowed.add(role);
                        }
                    }
                }
                servletSecurity.setRolesAllowed(rolesAllowed);
                AnnotationValue httpMethodConstraintsValue = annotation.value("httpMethodConstraints");
                if (httpMethodConstraintsValue != null) {
                    AnnotationInstance[] httpMethodConstraints = httpMethodConstraintsValue.asNestedArray();
                    if (httpMethodConstraints.length > 0) {
                        List<HttpMethodConstraintMetaData> methodConstraints = new ArrayList<HttpMethodConstraintMetaData>();
                        for (AnnotationInstance httpMethodConstraint : httpMethodConstraints) {
                            HttpMethodConstraintMetaData methodConstraint = new HttpMethodConstraintMetaData();
                            AnnotationValue httpMethodConstraintValue = httpMethodConstraint.value();
                            if (httpMethodConstraintValue != null) {
                                methodConstraint.setMethod(httpMethodConstraintValue.asString());
                            }
                            AnnotationValue httpMethodConstraintERSValue = httpMethodConstraint.value("emptyRoleSemantic");
                            if (httpMethodConstraintERSValue != null) {
                                methodConstraint.setEmptyRoleSemantic(EmptyRoleSemanticType.valueOf(httpMethodConstraintERSValue.asEnum()));
                            }
                            AnnotationValue httpMethodConstraintTGValue = httpMethodConstraint.value("transportGuarantee");
                            if (httpMethodConstraintTGValue != null) {
                                methodConstraint.setTransportGuarantee(TransportGuaranteeType.valueOf(httpMethodConstraintTGValue.asEnum()));
                            }
                            AnnotationValue rolesAllowedValue = httpMethodConstraint.value("rolesAllowed");
                            rolesAllowed = new ArrayList<String>();
                            if (rolesAllowedValue != null) {
                                for (String role : rolesAllowedValue.asStringArray()) {
                                    rolesAllowed.add(role);
                                }
                            }
                            methodConstraint.setRolesAllowed(rolesAllowed);
                            methodConstraints.add(methodConstraint);
                        }
                        servletSecurity.setHttpMethodConstraints(methodConstraints);
                    }
                }
                annotationMD.setServletSecurity(servletSecurity);
            }
        }
View Full Code Here

                if (annotationMD == null) {
                    annotationMD = new AnnotationMetaData();
                    annotationMD.setClassName(classInfo.toString());
                    annotations.add(annotationMD);
                }
                ServletSecurityMetaData servletSecurity = new ServletSecurityMetaData();
                AnnotationValue httpConstraintValue = annotation.value();
                List<String> rolesAllowed = new ArrayList<String>();
                if (httpConstraintValue != null) {
                    AnnotationInstance httpConstraint = httpConstraintValue.asNested();
                    AnnotationValue httpConstraintERSValue = httpConstraint.value();
                    if (httpConstraintERSValue != null) {
                        servletSecurity.setEmptyRoleSemantic(EmptyRoleSemanticType.valueOf(httpConstraintERSValue.asEnum()));
                    }
                    AnnotationValue httpConstraintTGValue = httpConstraint.value("transportGuarantee");
                    if (httpConstraintTGValue != null) {
                        servletSecurity.setTransportGuarantee(TransportGuaranteeType.valueOf(httpConstraintTGValue.asEnum()));
                    }
                    AnnotationValue rolesAllowedValue = httpConstraint.value("rolesAllowed");
                    if (rolesAllowedValue != null) {
                        for (String role : rolesAllowedValue.asStringArray()) {
                            rolesAllowed.add(role);
                        }
                    }
                }
                servletSecurity.setRolesAllowed(rolesAllowed);
                AnnotationValue httpMethodConstraintsValue = annotation.value("httpMethodConstraints");
                if (httpMethodConstraintsValue != null) {
                    AnnotationInstance[] httpMethodConstraints = httpMethodConstraintsValue.asNestedArray();
                    if (httpMethodConstraints.length > 0) {
                        List<HttpMethodConstraintMetaData> methodConstraints = new ArrayList<HttpMethodConstraintMetaData>();
                        for (AnnotationInstance httpMethodConstraint : httpMethodConstraints) {
                            HttpMethodConstraintMetaData methodConstraint = new HttpMethodConstraintMetaData();
                            AnnotationValue httpMethodConstraintValue = httpMethodConstraint.value();
                            if (httpMethodConstraintValue != null) {
                                methodConstraint.setMethod(httpMethodConstraintValue.asString());
                            }
                            AnnotationValue httpMethodConstraintERSValue = httpMethodConstraint.value("emptyRoleSemantic");
                            if (httpMethodConstraintERSValue != null) {
                                methodConstraint.setEmptyRoleSemantic(EmptyRoleSemanticType.valueOf(httpMethodConstraintERSValue.asEnum()));
                            }
                            AnnotationValue httpMethodConstraintTGValue = httpMethodConstraint.value("transportGuarantee");
                            if (httpMethodConstraintTGValue != null) {
                                methodConstraint.setTransportGuarantee(TransportGuaranteeType.valueOf(httpMethodConstraintTGValue.asEnum()));
                            }
                            AnnotationValue rolesAllowedValue = httpMethodConstraint.value("rolesAllowed");
                            rolesAllowed = new ArrayList<String>();
                            if (rolesAllowedValue != null) {
                                for (String role : rolesAllowedValue.asStringArray()) {
                                    rolesAllowed.add(role);
                                }
                            }
                            methodConstraint.setRolesAllowed(rolesAllowed);
                            methodConstraints.add(methodConstraint);
                        }
                        servletSecurity.setHttpMethodConstraints(methodConstraints);
                    }
                }
                annotationMD.setServletSecurity(servletSecurity);
            }
        }
View Full Code Here

                            multipartConfig.setFileSizeThreshold(multipartConfigMetaData.getFileSizeThreshold());
                            wrapper.setMultipartConfig(multipartConfig);
                        }
                        // Merge @ServletSecurity
                        if (annotation.getServletSecurity() != null && wrapper.getServletSecurity() == null) {
                            ServletSecurityMetaData servletSecurityAnnotation = annotation.getServletSecurity();
                            Collection<HttpMethodConstraintElement> methodConstraints = null;

                            EmptyRoleSemantic emptyRoleSemantic = EmptyRoleSemantic.PERMIT;
                            if (servletSecurityAnnotation.getEmptyRoleSemantic() != null) {
                                emptyRoleSemantic = EmptyRoleSemantic.valueOf(servletSecurityAnnotation.getEmptyRoleSemantic()
                                        .toString());
                            }
                            TransportGuarantee transportGuarantee = TransportGuarantee.NONE;
                            if (servletSecurityAnnotation.getTransportGuarantee() != null) {
                                transportGuarantee = TransportGuarantee.valueOf(servletSecurityAnnotation
                                        .getTransportGuarantee().toString());
                            }
                            String[] roleNames = servletSecurityAnnotation.getRolesAllowed().toArray(new String[0]);
                            HttpConstraintElement constraint = new HttpConstraintElement(emptyRoleSemantic, transportGuarantee,
                                    roleNames);

                            if (servletSecurityAnnotation.getHttpMethodConstraints() != null) {
                                methodConstraints = new HashSet<HttpMethodConstraintElement>();
                                for (HttpMethodConstraintMetaData annotationMethodConstraint : servletSecurityAnnotation
                                        .getHttpMethodConstraints()) {
                                    emptyRoleSemantic = EmptyRoleSemantic.PERMIT;
                                    if (annotationMethodConstraint.getEmptyRoleSemantic() != null) {
                                        emptyRoleSemantic = EmptyRoleSemantic.valueOf(annotationMethodConstraint
                                                .getEmptyRoleSemantic().toString());
View Full Code Here

                            multipartConfig.setFileSizeThreshold(multipartConfigMetaData.getFileSizeThreshold());
                            wrapper.setMultipartConfig(multipartConfig);
                        }
                        // Merge @ServletSecurity
                        if (annotation.getServletSecurity() != null && wrapper.getServletSecurity() == null) {
                            ServletSecurityMetaData servletSecurityAnnotation = annotation.getServletSecurity();
                            Collection<HttpMethodConstraintElement> methodConstraints = null;

                            EmptyRoleSemantic emptyRoleSemantic = EmptyRoleSemantic.PERMIT;
                            if (servletSecurityAnnotation.getEmptyRoleSemantic() != null) {
                                emptyRoleSemantic = EmptyRoleSemantic.valueOf(servletSecurityAnnotation.getEmptyRoleSemantic()
                                        .toString());
                            }
                            TransportGuarantee transportGuarantee = TransportGuarantee.NONE;
                            if (servletSecurityAnnotation.getTransportGuarantee() != null) {
                                transportGuarantee = TransportGuarantee.valueOf(servletSecurityAnnotation
                                        .getTransportGuarantee().toString());
                            }
                            String[] roleNames = servletSecurityAnnotation.getRolesAllowed().toArray(new String[0]);
                            HttpConstraintElement constraint = new HttpConstraintElement(emptyRoleSemantic, transportGuarantee,
                                    roleNames);

                            if (servletSecurityAnnotation.getHttpMethodConstraints() != null) {
                                methodConstraints = new HashSet<HttpMethodConstraintElement>();
                                for (HttpMethodConstraintMetaData annotationMethodConstraint : servletSecurityAnnotation
                                        .getHttpMethodConstraints()) {
                                    emptyRoleSemantic = EmptyRoleSemantic.PERMIT;
                                    if (annotationMethodConstraint.getEmptyRoleSemantic() != null) {
                                        emptyRoleSemantic = EmptyRoleSemantic.valueOf(annotationMethodConstraint
                                                .getEmptyRoleSemantic().toString());
View Full Code Here

                            multipartConfig.setFileSizeThreshold(multipartConfigMetaData.getFileSizeThreshold());
                            wrapper.setMultipartConfig(multipartConfig);
                        }
                        // Merge @ServletSecurity
                        if (annotation.getServletSecurity() != null && wrapper.getServletSecurity() == null) {
                            ServletSecurityMetaData servletSecurityAnnotation = annotation.getServletSecurity();
                            Collection<HttpMethodConstraintElement> methodConstraints = null;

                            EmptyRoleSemantic emptyRoleSemantic = EmptyRoleSemantic.PERMIT;
                            if (servletSecurityAnnotation.getEmptyRoleSemantic() != null) {
                                emptyRoleSemantic = EmptyRoleSemantic.valueOf(servletSecurityAnnotation.getEmptyRoleSemantic()
                                        .toString());
                            }
                            TransportGuarantee transportGuarantee = TransportGuarantee.NONE;
                            if (servletSecurityAnnotation.getTransportGuarantee() != null) {
                                transportGuarantee = TransportGuarantee.valueOf(servletSecurityAnnotation
                                        .getTransportGuarantee().toString());
                            }
                            String[] roleNames = servletSecurityAnnotation.getRolesAllowed().toArray(new String[0]);
                            HttpConstraintElement constraint = new HttpConstraintElement(emptyRoleSemantic, transportGuarantee,
                                    roleNames);

                            if (servletSecurityAnnotation.getHttpMethodConstraints() != null) {
                                methodConstraints = new HashSet<HttpMethodConstraintElement>();
                                for (HttpMethodConstraintMetaData annotationMethodConstraint : servletSecurityAnnotation
                                        .getHttpMethodConstraints()) {
                                    emptyRoleSemantic = EmptyRoleSemantic.PERMIT;
                                    if (annotationMethodConstraint.getEmptyRoleSemantic() != null) {
                                        emptyRoleSemantic = EmptyRoleSemantic.valueOf(annotationMethodConstraint
                                                .getEmptyRoleSemantic().toString());
View Full Code Here

                            multipartConfig.setFileSizeThreshold(multipartConfigMetaData.getFileSizeThreshold());
                            wrapper.setMultipartConfig(multipartConfig);
                        }
                        // Merge @ServletSecurity
                        if (annotation.getServletSecurity() != null && wrapper.getServletSecurity() == null) {
                            ServletSecurityMetaData servletSecurityAnnotation = annotation.getServletSecurity();
                            Collection<HttpMethodConstraintElement> methodConstraints = null;

                            EmptyRoleSemantic emptyRoleSemantic = EmptyRoleSemantic.PERMIT;
                            if (servletSecurityAnnotation.getEmptyRoleSemantic() != null) {
                                emptyRoleSemantic = EmptyRoleSemantic.valueOf(servletSecurityAnnotation.getEmptyRoleSemantic()
                                        .toString());
                            }
                            TransportGuarantee transportGuarantee = TransportGuarantee.NONE;
                            if (servletSecurityAnnotation.getTransportGuarantee() != null) {
                                transportGuarantee = TransportGuarantee.valueOf(servletSecurityAnnotation
                                        .getTransportGuarantee().toString());
                            }
                            String[] roleNames = servletSecurityAnnotation.getRolesAllowed().toArray(new String[0]);
                            HttpConstraintElement constraint = new HttpConstraintElement(emptyRoleSemantic, transportGuarantee,
                                    roleNames);

                            if (servletSecurityAnnotation.getHttpMethodConstraints() != null) {
                                methodConstraints = new HashSet<HttpMethodConstraintElement>();
                                for (HttpMethodConstraintMetaData annotationMethodConstraint : servletSecurityAnnotation
                                        .getHttpMethodConstraints()) {
                                    emptyRoleSemantic = EmptyRoleSemantic.PERMIT;
                                    if (annotationMethodConstraint.getEmptyRoleSemantic() != null) {
                                        emptyRoleSemantic = EmptyRoleSemantic.valueOf(annotationMethodConstraint
                                                .getEmptyRoleSemantic().toString());
View Full Code Here

TOP

Related Classes of org.jboss.metadata.web.spec.ServletSecurityMetaData

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.