Examples of HibernateIdentityObject


Examples of org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject

   public Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx, IdentityObject identity, IdentityObjectSearchCriteria constraints) throws IdentityException, OperationNotSupportedException
   {

      Set<String> names;

      HibernateIdentityObject hibernateObject = safeGet(ctx, identity);

      Session em = getHibernateSession(ctx);

      try
      {
View Full Code Here

Examples of org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject

      }
   }

   public Map<String, String> getRelationshipProperties(IdentityStoreInvocationContext ctx, IdentityObjectRelationship relationship) throws IdentityException, OperationNotSupportedException
   {
      HibernateIdentityObject fromIO = safeGet(ctx, relationship.getFromIdentityObject());
      HibernateIdentityObject toIO = safeGet(ctx, relationship.getToIdentityObject());
      HibernateIdentityObjectRelationshipType type = getHibernateIdentityObjectRelationshipType(ctx, relationship.getType());

      Query query = null;

      if (relationship.getName() == null)
View Full Code Here

Examples of org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject

      }
   }

   public void setRelationshipProperties(IdentityStoreInvocationContext ctx, IdentityObjectRelationship relationship, Map<String, String> properties) throws IdentityException, OperationNotSupportedException
   {
      HibernateIdentityObject fromIO = safeGet(ctx, relationship.getFromIdentityObject());
      HibernateIdentityObject toIO = safeGet(ctx, relationship.getToIdentityObject());
      HibernateIdentityObjectRelationshipType type = getHibernateIdentityObjectRelationshipType(ctx, relationship.getType());

      Query query = null;

      if (relationship.getName() == null)
View Full Code Here

Examples of org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject

      }
   }

   public void removeRelationshipProperties(IdentityStoreInvocationContext ctx, IdentityObjectRelationship relationship, Set<String> properties) throws IdentityException, OperationNotSupportedException
   {
      HibernateIdentityObject fromIO = safeGet(ctx, relationship.getFromIdentityObject());
      HibernateIdentityObject toIO = safeGet(ctx, relationship.getToIdentityObject());
      HibernateIdentityObjectRelationshipType type = getHibernateIdentityObjectRelationshipType(ctx, relationship.getType());

      Query query = null;

      if (relationship.getName() == null)
View Full Code Here

Examples of org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject

   }

   public IdentityObjectAttribute getAttribute(IdentityStoreInvocationContext ctx, IdentityObject identity, String name) throws IdentityException
   {
      HibernateIdentityObject hibernateObject = safeGet(ctx, identity);

      Set<HibernateIdentityObjectAttribute> storeAttributes =  hibernateObject.getAttributes();

      // Remap the names
      for (HibernateIdentityObjectAttribute attribute : storeAttributes)
      {
         String mappedName = resolveAttributeNameFromStoreMapping(identity.getIdentityType(), name);
View Full Code Here

Examples of org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject

   }

   public Map<String, IdentityObjectAttribute> getAttributes(IdentityStoreInvocationContext ctx, IdentityObject identity) throws IdentityException
   {

      HibernateIdentityObject hibernateObject = safeGet(ctx, identity);

      Set<HibernateIdentityObjectAttribute> storeAttributes =  hibernateObject.getAttributes();
      Map<String, IdentityObjectAttribute> result = new HashMap<String, IdentityObjectAttribute>();
     
      // Remap the names
      for (HibernateIdentityObjectAttribute attribute : storeAttributes)
      {
View Full Code Here

Examples of org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject

            }
         }
      }


      HibernateIdentityObject hibernateObject = safeGet(ctx, identity);

      for (String name : mappedAttributes.keySet())
      {
         IdentityObjectAttribute attribute = mappedAttributes.get(name);

         IdentityObjectAttributeMetaData amd = mdMap.get(attribute.getName());

         // Default to text
         String type = amd != null ? amd.getType() : IdentityObjectAttributeMetaData.TEXT_TYPE;

         for (HibernateIdentityObjectAttribute storeAttribute : hibernateObject.getAttributes())
         {
            if (storeAttribute.getName().equals(name))
            {
               if (storeAttribute instanceof HibernateIdentityObjectTextAttribute)
               {
View Full Code Here

Examples of org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject

               }
            }
         }
      }

      HibernateIdentityObject hibernateObject = safeGet(ctx, identity);

      for (String name : mappedAttributes.keySet())
      {
         IdentityObjectAttribute attribute = mappedAttributes.get(name);

         IdentityObjectAttributeMetaData amd = mdMap.get(attribute.getName());

         // Default to text
         String type = amd != null ? amd.getType() : IdentityObjectAttributeMetaData.TEXT_TYPE;

         HibernateIdentityObjectAttribute hibernateAttribute = null;

         for (HibernateIdentityObjectAttribute storeAttribute : hibernateObject.getAttributes())
         {
            if (storeAttribute.getName().equals(name))
            {
               hibernateAttribute = storeAttribute;
               break;
            }
         }

         if (hibernateAttribute != null)
         {
            if (hibernateAttribute instanceof HibernateIdentityObjectTextAttribute)
               {
                  if (!type.equals(IdentityObjectAttributeMetaData.TEXT_TYPE))
                  {
                     throw new IdentityException("Wrong attribute mapping. Attribute persisted as text is mapped with: "
                     + type + ". Attribute name: " + name);
                  }


                  Set<String> mergedValues = new HashSet<String>(hibernateAttribute.getValues());
                  for (Object value : attribute.getValues())
                  {
                     mergedValues.add(value.toString());
                  }

                  ((HibernateIdentityObjectTextAttribute)hibernateAttribute).setValues(mergedValues);
               }
               else if (hibernateAttribute instanceof HibernateIdentityObjectBinaryAttribute)
               {

                  if (!type.equals(IdentityObjectAttributeMetaData.BINARY_TYPE))
                  {
                     throw new IdentityException("Wrong attribute mapping. Attribute persisted as binary is mapped with: "
                     + type + ". Attribute name: " + name);
                  }

                  Set<byte[]> mergedValues = new HashSet<byte[]>(hibernateAttribute.getValues());
                  for (Object value : attribute.getValues())
                  {
                     mergedValues.add((byte[])value);
                  }

                  ((HibernateIdentityObjectBinaryAttribute)hibernateAttribute).setValues(mergedValues);
               }
               else
               {
                  throw new IdentityException("Internal identity store error");
               }
               break;

         }
         else
         {
            if (type.equals(IdentityObjectAttributeMetaData.TEXT_TYPE))
            {
               Set<String> values = new HashSet<String>();

               for (Object value: attribute.getValues())
               {
                  values.add(value.toString());
               }
               hibernateAttribute = new HibernateIdentityObjectTextAttribute(hibernateObject, name, values);
            }
            else if (type.equals(IdentityObjectAttributeMetaData.BINARY_TYPE))
            {
               Set<byte[]> values = new HashSet<byte[]>();

               for (Object value: attribute.getValues())
               {
                  values.add((byte[])value);
               }
               hibernateAttribute = new HibernateIdentityObjectBinaryAttribute(hibernateObject, name, values);
            }


            hibernateObject.addAttribute(hibernateAttribute);

         }
      }
   }
View Full Code Here

Examples of org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject

            }
         }

      }

      HibernateIdentityObject hibernateObject = safeGet(ctx, identity);

      for (String attr : mappedAttributes)
      {
         hibernateObject.removeAttribute(attr);
      }
   }
View Full Code Here

Examples of org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject

      if (credential == null)
      {
         throw new IllegalArgumentException();
      }

      HibernateIdentityObject hibernateObject = safeGet(ctx, identityObject);

      if (supportedFeatures.isCredentialSupported(hibernateObject.getIdentityType(),credential.getType()))
      {

         HibernateIdentityObjectCredential hibernateCredential = null;

         hibernateCredential = (HibernateIdentityObjectCredential)getHibernateSession(ctx).
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.