Examples of RunAsIdentityMetaData


Examples of org.jboss.metadata.javaee.jboss.RunAsIdentityMetaData

    * @return RunAsIdentity for the servet if one exists, null otherwise
    */
   @XmlTransient
   public RunAsIdentityMetaData getRunAsIdentity(String servletName)
   {
      RunAsIdentityMetaData identity = runAsIdentity.get(servletName);
      if (identity == null)
      {
         JBossServletsMetaData servlets = getServlets();
         if(servlets != null)
         {
            ServletMetaData servlet = servlets.get(servletName);
            if (servlet != null)
            {
               // Check for a web.xml run-as only specification
               synchronized (runAsIdentity)
               {
                  RunAsMetaData runAs = servlet.getRunAs();
                  if (runAs != null)
                  {
                     String roleName = runAs.getRoleName();
                     identity = new RunAsIdentityMetaData(roleName, null);
                     runAsIdentity.put(servletName, identity);
                  }
               }
            }
         }
View Full Code Here

Examples of org.jboss.metadata.javaee.jboss.RunAsIdentityMetaData

                  webXmlRunAs = "PLACEHOLDER_FOR_ANNOTATION";
                  //throw new IllegalStateException("run-as-principal: " + principalName + " found in jboss-web.xml but there was no run-as in web.xml");
               }
               // See if there are any additional roles for this principal
               Set<String> extraRoles = securityRoles.getSecurityRoleNamesByPrincipal(principalName);
               RunAsIdentityMetaData runAsId = new RunAsIdentityMetaData(webXmlRunAs, principalName, extraRoles);
               runAsIdentity.put(servletName, runAsId);
            }
            else if (webXmlRunAs != null)
            {
               RunAsIdentityMetaData runAsId = new RunAsIdentityMetaData(webXmlRunAs, null);
               runAsIdentity.put(servletName, runAsId);
            }
         }
      }
   }
View Full Code Here

Examples of org.jboss.metadata.javaee.jboss.RunAsIdentityMetaData

            Wrapper servlet = null;
            try {
                servlet = request.getWrapper();
                if (servlet != null) {
                    String name = servlet.getName();
                    RunAsIdentityMetaData identity = metaData.getRunAsIdentity(name);
                    RunAsIdentity runAsIdentity = null;
                    if (identity != null) {
                        WebLogger.WEB_SECURITY_LOGGER.tracef(name + ", runAs: " + identity);
                        runAsIdentity = new RunAsIdentity(identity.getRoleName(), identity.getPrincipalName(),
                                identity.getRunAsRoles());
                    }
                    SecurityActions.pushRunAsIdentity(runAsIdentity);
                }

                // If there is a session, get the tomcat session for the principal
View Full Code Here

Examples of org.jboss.metadata.javaee.jboss.RunAsIdentityMetaData

    * @return RunAsIdentity for the servet if one exists, null otherwise
    */
   @XmlTransient
   public RunAsIdentityMetaData getRunAsIdentity(String servletName)
   {
      RunAsIdentityMetaData identity = runAsIdentity.get(servletName);
      if (identity == null)
      {
         JBossServletsMetaData servlets = getServlets();
         if(servlets != null)
         {
            ServletMetaData servlet = servlets.get(servletName);
            if (servlet != null)
            {
               // Check for a web.xml run-as only specification
               synchronized (runAsIdentity)
               {
                  RunAsMetaData runAs = servlet.getRunAs();
                  if (runAs != null)
                  {
                     String roleName = runAs.getRoleName();
                     identity = new RunAsIdentityMetaData(roleName, null);
                     runAsIdentity.put(servletName, identity);
                  }
               }
            }
         }
View Full Code Here

Examples of org.jboss.metadata.javaee.jboss.RunAsIdentityMetaData

                  webXmlRunAs = "PLACEHOLDER_FOR_ANNOTATION";
                  //throw new IllegalStateException("run-as-principal: " + principalName + " found in jboss-web.xml but there was no run-as in web.xml");
               }
               // See if there are any additional roles for this principal
               Set<String> extraRoles = securityRoles.getSecurityRoleNamesByPrincipal(principalName);
               RunAsIdentityMetaData runAsId = new RunAsIdentityMetaData(webXmlRunAs, principalName, extraRoles);
               runAsIdentity.put(servletName, runAsId);
            }
            else if (webXmlRunAs != null)
            {
               RunAsIdentityMetaData runAsId = new RunAsIdentityMetaData(webXmlRunAs, null);
               runAsIdentity.put(servletName, runAsId);
            }
         }
      }
   }
View Full Code Here

Examples of org.jboss.metadata.javaee.jboss.RunAsIdentityMetaData

/*     */   }
/*     */
/*     */   @XmlTransient
/*     */   public RunAsIdentityMetaData getRunAsIdentity(String ejbName)
/*     */   {
/* 602 */     RunAsIdentityMetaData identity = (RunAsIdentityMetaData)this.runAsIdentity.get(ejbName);
/* 603 */     if (identity == null)
/*     */     {
/* 605 */       JBossEnterpriseBeanMetaData ejb = getEnterpriseBean(ejbName);
/* 606 */       if (ejb != null)
/*     */       {
/* 609 */         synchronized (this.runAsIdentity)
/*     */         {
/* 611 */           SecurityIdentityMetaData si = ejb.getSecurityIdentity();
/* 612 */           if (si != null)
/*     */           {
/* 614 */             RunAsMetaData runAs = si.getRunAs();
/* 615 */             if (runAs != null)
/*     */             {
/* 617 */               String roleName = runAs.getRoleName();
/* 618 */               identity = new RunAsIdentityMetaData(roleName, null);
/* 619 */               this.runAsIdentity.put(ejbName, identity);
/*     */             }
/*     */           }
/*     */         }
/*     */       }
View Full Code Here

Examples of org.jboss.metadata.javaee.jboss.RunAsIdentityMetaData

/* 746 */           Set extraRoles = null;
/* 747 */           if (getAssemblyDescriptor() != null)
/*     */           {
/* 749 */             extraRoles = getAssemblyDescriptor().getSecurityRoleNamesByPrincipal(principalName);
/*     */           }
/* 751 */           RunAsIdentityMetaData runAsId = new RunAsIdentityMetaData(ejbXmlRunAs, principalName, extraRoles);
/* 752 */           this.runAsIdentity.put(ejbName, runAsId);
/*     */         }
/* 754 */         else if (ejbXmlRunAs != null)
/*     */         {
/* 756 */           RunAsIdentityMetaData runAsId = new RunAsIdentityMetaData(ejbXmlRunAs, null);
/* 757 */           this.runAsIdentity.put(ejbName, runAsId);
/*     */         }
/*     */       }
/*     */     }
/*     */   }
View Full Code Here

Examples of org.jboss.metadata.javaee.jboss.RunAsIdentityMetaData

/*      */   }
/*      */
/*      */   @XmlTransient
/*      */   public RunAsIdentityMetaData getRunAsIdentity(String servletName)
/*      */   {
/*  810 */     RunAsIdentityMetaData identity = (RunAsIdentityMetaData)this.runAsIdentity.get(servletName);
/*  811 */     if (identity == null)
/*      */     {
/*  813 */       JBossServletsMetaData servlets = getServlets();
/*  814 */       if (servlets != null)
/*      */       {
/*  816 */         ServletMetaData servlet = (ServletMetaData)servlets.get(servletName);
/*  817 */         if (servlet != null)
/*      */         {
/*  820 */           synchronized (this.runAsIdentity)
/*      */           {
/*  822 */             RunAsMetaData runAs = servlet.getRunAs();
/*  823 */             if (runAs != null)
/*      */             {
/*  825 */               String roleName = runAs.getRoleName();
/*  826 */               identity = new RunAsIdentityMetaData(roleName, null);
/*  827 */               this.runAsIdentity.put(servletName, identity);
/*      */             }
/*      */           }
/*      */         }
/*      */       }
View Full Code Here

Examples of org.jboss.metadata.javaee.jboss.RunAsIdentityMetaData

/*      */           {
/* 1065 */             throw new IllegalStateException("run-as-principal: " + principalName + " found in jboss-web.xml but there was no run-as in web.xml");
/*      */           }
/*      */
/* 1068 */           Set extraRoles = this.securityRoles.getSecurityRoleNamesByPrincipal(principalName);
/* 1069 */           RunAsIdentityMetaData runAsId = new RunAsIdentityMetaData(webXmlRunAs, principalName, extraRoles);
/* 1070 */           this.runAsIdentity.put(servletName, runAsId);
/*      */         }
/* 1072 */         else if (webXmlRunAs != null)
/*      */         {
/* 1074 */           RunAsIdentityMetaData runAsId = new RunAsIdentityMetaData(webXmlRunAs, null);
/* 1075 */           this.runAsIdentity.put(servletName, runAsId);
/*      */         }
/*      */       }
/*      */     }
/*      */   }
View Full Code Here

Examples of org.jboss.metadata.javaee.jboss.RunAsIdentityMetaData

     *
     * @param servletName - the servlet-name from the web.xml
     * @return RunAsIdentity for the servet if one exists, null otherwise
     */
    public RunAsIdentityMetaData getRunAsIdentity(String servletName) {
        RunAsIdentityMetaData identity = runAsIdentity.get(servletName);
        if (identity == null) {
            JBossServletsMetaData servlets = getServlets();
            if (servlets != null) {
                ServletMetaData servlet = servlets.get(servletName);
                if (servlet != null) {
                    // Check for a web.xml run-as only specification
                    RunAsMetaData runAs = servlet.getRunAs();
                    if (runAs != null) {
                        String roleName = runAs.getRoleName();
                        identity = new RunAsIdentityMetaData(roleName, null);
                        runAsIdentity.put(servletName, identity);
                    }
                }
            }
        }
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.