Examples of JpaIdentityStore


Examples of org.jboss.seam.security.management.JpaIdentityStore

    */
   protected Object resolvePrincipalEntity(Principal recipient)
   {
      boolean recipientIsRole = recipient instanceof Role;
        
      JpaIdentityStore identityStore = (JpaIdentityStore) Component.getInstance(JpaIdentityStore.class, true);
     
      if (identityStore != null)
      {
         if (recipientIsRole && roleProperty.isSet() && roleProperty.getPropertyType().equals(identityStore.getRoleClass()))
         {
            return identityStore.lookupRole(recipient.getName());
         }
         else if (userProperty.getPropertyType().equals(identityStore.getUserClass()))
         {
            return identityStore.lookupUser(recipient.getName());
         }
      }     
     
      return recipient.getName();
   }
View Full Code Here

Examples of org.jboss.seam.security.management.JpaIdentityStore

   }
  
   protected Principal resolvePrincipal(Object principal, boolean isUser)
   {
      IdentityStore ids = IdentityManager.instance().getRoleIdentityStore();
      JpaIdentityStore identityStore = null;
     
      if (ids instanceof JpaIdentityStore) identityStore = (JpaIdentityStore) ids;
     
      if (principal instanceof String)
      {       
         return isUser ? new SimplePrincipal((String) principal) : new Role((String) principal,
               identityStore == null ? false : identityStore.isRoleConditional((String) principal));
      }     
     
      if (identityStore != null)
      {
         if (isUser && identityStore.getUserClass().equals(principal.getClass()))
         {
            return new SimplePrincipal(identityStore.getUserName(principal));
         }
        
         if (!isUser && identityStore.getRoleClass().equals(principal.getClass()))
         {
            String name = identityStore.getRoleName(principal);
            return new Role(name, identityStore.isRoleConditional(name));
         }
      }
     
      throw new IllegalArgumentException("Cannot resolve principal name for principal " + principal);
   }
View Full Code Here

Examples of org.jboss.seam.security.management.JpaIdentityStore

    */
   protected Object resolvePrincipalEntity(Principal recipient)
   {
      boolean recipientIsRole = recipient instanceof Role;
        
      JpaIdentityStore identityStore = (JpaIdentityStore) Component.getInstance(JpaIdentityStore.class, true);
     
      if (identityStore != null)
      {
         if (recipientIsRole && roleProperty.isSet() && roleProperty.getPropertyType().equals(identityStore.getRoleClass()))
         {
            return identityStore.lookupRole(recipient.getName());
         }
         else if (userProperty.getPropertyType().equals(identityStore.getUserClass()))
         {
            return identityStore.lookupUser(recipient.getName());
         }
      }     
     
      return recipient.getName();
   }
View Full Code Here

Examples of org.jboss.seam.security.management.JpaIdentityStore

   }
  
   protected Principal resolvePrincipal(Object principal, boolean isUser)
   {
      IdentityStore ids = IdentityManager.instance().getRoleIdentityStore();
      JpaIdentityStore identityStore = null;
     
      if (ids instanceof JpaIdentityStore) identityStore = (JpaIdentityStore) ids;
     
      if (principal instanceof String)
      {       
         return isUser ? new SimplePrincipal((String) principal) : new Role((String) principal,
               identityStore == null ? false : identityStore.isRoleConditional((String) principal));
      }     
     
      if (identityStore != null)
      {
         if (isUser && identityStore.getUserClass().equals(principal.getClass()))
         {
            return new SimplePrincipal(identityStore.getUserName(principal));
         }
        
         if (!isUser && identityStore.getRoleClass().equals(principal.getClass()))
         {
            String name = identityStore.getRoleName(principal);
            return new Role(name, identityStore.isRoleConditional(name));
         }
      }
     
      throw new IllegalArgumentException("Cannot resolve principal name for principal " + principal);
   }
View Full Code Here

Examples of org.jboss.seam.security.management.JpaIdentityStore

    */
   protected Object resolvePrincipalEntity(Principal recipient)
   {
      boolean recipientIsRole = recipient instanceof Role;
        
      JpaIdentityStore identityStore = (JpaIdentityStore) Component.getInstance(JpaIdentityStore.class, true);
     
      if (identityStore != null)
      {
         if (recipientIsRole && roleProperty.isSet() && roleProperty.getPropertyType().equals(identityStore.getRoleClass()))
         {
            return identityStore.lookupRole(recipient.getName());
         }
         else if (userProperty.getPropertyType().equals(identityStore.getUserClass()))
         {
            return identityStore.lookupUser(recipient.getName());
         }
      }     
     
      return recipient.getName();
   }
View Full Code Here

Examples of org.jboss.seam.security.management.JpaIdentityStore

   }
  
   protected Principal resolvePrincipal(Object principal, boolean isUser)
   {
      IdentityStore ids = IdentityManager.instance().getRoleIdentityStore();
      JpaIdentityStore identityStore = null;
     
      if (ids instanceof JpaIdentityStore) identityStore = (JpaIdentityStore) ids;
     
      if (principal instanceof String)
      {       
         return isUser ? new SimplePrincipal((String) principal) : new Role((String) principal,
               identityStore == null ? false : identityStore.isRoleConditional((String) principal));
      }     
     
      if (identityStore != null)
      {
         if (isUser && identityStore.getUserClass().isAssignableFrom(principal.getClass()))
         {
            return new SimplePrincipal(identityStore.getUserName(principal));
         }
        
         if (!isUser && identityStore.getRoleClass().isAssignableFrom(principal.getClass()))
         {
            String name = identityStore.getRoleName(principal);
            return new Role(name, identityStore.isRoleConditional(name));
         }
      }
     
      throw new IllegalArgumentException("Cannot resolve principal name for principal " + principal);
   }
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.