Examples of IdentityException


Examples of org.picketlink.idm.common.exception.IdentityException

         {
            modelProperties.put(PROPERTY_ATTRIBUTE_NAME, props.get(0));
         }
         else if (props.size() > 1)
         {
            throw new IdentityException(
                "Ambiguous attribute name property in class " +
                attributeClass.getName());
         }
         else
         {
            Property<Object> prop = findNamedProperty(attributeClass,
                  "attributeName", "name");
            if (prop != null) modelProperties.put(PROPERTY_ATTRIBUTE_NAME, prop);
         }
        
         props = PropertyQueries.createQuery(attributeClass)
            .addCriteria(new PropertyTypeCriteria(PropertyType.VALUE))
            .getResultList();
        
         if (props.size() == 1)
         {
            modelProperties.put(PROPERTY_ATTRIBUTE_VALUE, props.get(0));
         }
         else if (props.size() > 1)
         {
            throw new IdentityException(
                  "Ambiguous attribute value property in class " +
                  attributeClass.getName());
         }
         else
         {
            Property<Object> prop = findNamedProperty(attributeClass,
                  "attributeValue", "value");
            if (prop != null) modelProperties.put(PROPERTY_ATTRIBUTE_VALUE, prop);
         }
        
         props = PropertyQueries.createQuery(attributeClass)
            .addCriteria(new TypedPropertyCriteria(identityClass))
            .getResultList();
        
         if (props.size() == 1)
         {
            modelProperties.put(PROPERTY_ATTRIBUTE_IDENTITY, props.get(0));
         }
         else if (props.size() > 1)
         {
            throw new IdentityException(
                  "Ambiguous identity property in attribute class " +
                  attributeClass.getName());
         }
         else
         {
            throw new IdentityException("Error initializing JpaIdentityStore - " +
                  "no attribute identity property found.");
         }
        
         props = PropertyQueries.createQuery(attributeClass)
            .addCriteria(new PropertyTypeCriteria(PropertyType.TYPE))
            .getResultList();
        
         if (props.size() == 1)
         {
            modelProperties.put(PROPERTY_ATTRIBUTE_TYPE, props.get(0));
         }
         else if (props.size() > 1)
         {
            throw new IdentityException(
                  "Ambiguous attribute type property in class " +
                  attributeClass.getName());
         }
      }
View Full Code Here

Examples of org.picketlink.idm.common.exception.IdentityException

         return obj;
      }
      catch (Exception ex)
      {
         throw new IdentityException("Error creating identity object", ex);
      }   
   }
View Full Code Here

Examples of org.picketlink.idm.common.exception.IdentityException

         return new IdentityObjectRelationshipImpl(fromIdentity, toIdentity,
               relationshipName, relationshipType);
      }
      catch (Exception ex)
      {
         throw new IdentityException("Exception creating relationship", ex);
      }
   }
View Full Code Here

Examples of org.picketlink.idm.common.exception.IdentityException

         em.persist(roleTypeInstance);
         return name;
      }
      catch (Exception ex)
      {
         throw new IdentityException("Error creating relationship name", ex);
      }
   }
View Full Code Here

Examples of org.picketlink.idm.common.exception.IdentityException

        
         em.remove(instance);
      }
      catch (NoResultException ex)
      {
         throw new IdentityException(String.format(
               "Exception removing identity object - [%s] not found.",
               identity), ex);
      }
   }
View Full Code Here

Examples of org.picketlink.idm.common.exception.IdentityException

              
               em.persist(newCredential);
            }
            catch (IllegalAccessException ex)
            {
               throw new IdentityException("Error updating credential - could " +
                     "not create credential instance", ex);
            }
            catch (InstantiationException ex)
            {
               throw new IdentityException("Error updating credential - could " +
                     "not create credential instance", ex);
            }
         }
         else
         {
View Full Code Here

Examples of org.picketlink.idm.common.exception.IdentityException

            }
         }
      }
      catch (Exception e)
      {
         throw new IdentityException("Error while adding attributes.", e);
      }     
   }
View Full Code Here

Examples of org.picketlink.idm.common.exception.IdentityException

                        attributeValueProp.setValue(attribute, ((Double) value).toString());
                        attributeTypeProp.setValue(attribute, ATTRIBUTE_TYPE_DOUBLE);
                     }
                     else
                     {
                        throw new IdentityException("Could not persist attribute value - unsupported attribute value type " +
                              value.getClass());
                     }
                  }
                  else
                  {
                     attributeValueProp.setValue(attribute, value.toString());
                  }
                 
                  em.persist(attribute);  
               }
            }
         }
      }
      catch (Exception e)
      {
         throw new IdentityException("Error while updating attributes.", e);
      }
   }
View Full Code Here

Examples of org.wso2.carbon.identity.base.IdentityException

    OpenIDAxAttribute axAttribute = null;

    if (attribute == null || attribute.trim().length() == 0 || namespace == null
        || namespace.trim().length() == 0) {
      throw new IdentityException("invalidInputParams");
    }

    axAttribute = new OpenIDAxAttribute(attribute, namespace);

    for (Object element : claims) {
      if (element instanceof OpenIDAxAttribute) {
        OpenIDAxAttribute attr = (OpenIDAxAttribute) element;
        if (attr.getAttributeName().equalsIgnoreCase(attribute)
            || attr.getNamespace().equalsIgnoreCase(namespace)) {
          throw new IdentityException("duplicatedAttributes");
        }
      }
    }

    if (!requestTypes.contains(IdentityConstants.OpenId.ATTRIBUTE_EXCHANGE)) {
View Full Code Here

Examples of org.wso2.carbon.identity.base.IdentityException

   * @throws RelyingPartyException
   */
  private void addClaims(String attribute, List<String> claims) throws IdentityException {

    if (attribute == null || attribute.trim().length() == 0) {
      throw new IdentityException("invalidInputParams");
    }
    if (claims.contains(attribute)) {
      throw new IdentityException("duplicatedAttributes");
    }
    if (!requestTypes.contains(IdentityConstants.OpenId.SIMPLE_REGISTRATION)) {
      requestTypes.add(IdentityConstants.OpenId.SIMPLE_REGISTRATION);
    }

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.