Package org.jboss.identity.idm.spi.store

Examples of org.jboss.identity.idm.spi.store.IdentityStore


      ArrayList<IdentityObjectAttribute> filteredAttrs = new ArrayList<IdentityObjectAttribute>();
      ArrayList<IdentityObjectAttribute> leftAttrs = new ArrayList<IdentityObjectAttribute>();

      IdentityObjectAttribute[] attributesToAdd = null;

      IdentityStore toStore = resolveIdentityStore(identity);
      IdentityStoreInvocationContext targetCtx = resolveInvocationContext(toStore, invocationCtx);

      // Put supported attrs to the main store
      if (toStore != defaultAttributeStore)
      {
         Set<String> supportedAttrs = toStore.getSupportedAttributeNames(targetCtx, identity.getIdentityType());

         // Filter out supported and not supported attributes
         for (IdentityObjectAttribute entry : attributes)
         {
            if (supportedAttrs.contains(entry.getName()))
            {
               filteredAttrs.add(entry);
            }
            else
            {
               leftAttrs.add(entry);
            }
         }

         toStore.updateAttributes(targetCtx, identity, filteredAttrs.toArray(new IdentityObjectAttribute[filteredAttrs.size()]));

         attributesToAdd = leftAttrs.toArray(new IdentityObjectAttribute[leftAttrs.size()]);

      }
      else
View Full Code Here


      ArrayList<IdentityObjectAttribute> filteredAttrs = new ArrayList<IdentityObjectAttribute>();
      ArrayList<IdentityObjectAttribute> leftAttrs = new ArrayList<IdentityObjectAttribute>();
      IdentityObjectAttribute[] attributesToAdd = null;

      IdentityStore toStore = resolveIdentityStore(identity);
      IdentityStoreInvocationContext targetCtx = resolveInvocationContext(toStore, invocationCtx);

      // Put supported attrs to the main store
      if (toStore != defaultAttributeStore)
      {
         Set<String> supportedAttrs = toStore.getSupportedAttributeNames(targetCtx, identity.getIdentityType());

         // Filter out supported and not supported attributes
         for (IdentityObjectAttribute entry : attributes)
         {
            if (supportedAttrs.contains(entry.getName()))
            {
               filteredAttrs.add(entry);
            }
            else
            {
               leftAttrs.add(entry);
            }
         }

         toStore.addAttributes(targetCtx, identity, filteredAttrs.toArray(new IdentityObjectAttribute[filteredAttrs.size()]));

         attributesToAdd = leftAttrs.toArray(new IdentityObjectAttribute[leftAttrs.size()]);


      }
View Full Code Here

   public void removeAttributes(IdentityStoreInvocationContext invocationCtx, IdentityObject identity, String[] attributes) throws IdentityException
   {
      List<String> filteredAttrs = new LinkedList<String>();
      List<String> leftAttrs = new LinkedList<String>();

      IdentityStore toStore = resolveIdentityStore(identity);
      IdentityStoreInvocationContext targetCtx = resolveInvocationContext(toStore, invocationCtx);

      // Put supported attrs to the main store
      if (toStore != defaultAttributeStore)
      {
         Set<String> supportedAttrs = toStore.getSupportedAttributeNames(targetCtx, identity.getIdentityType());

         // Filter out supported and not supported attributes
         for (String name : attributes)
         {
            if (supportedAttrs.contains(name))
            {
               filteredAttrs.add(name);
            }
            else
            {
               leftAttrs.add(name);
            }
         }

         toStore.removeAttributes(targetCtx, identity, filteredAttrs.toArray(new String[filteredAttrs.size()]));


      }
      else
      {
View Full Code Here

         Constructor ct = storeClass.getConstructor(partypes);
         Object argList[] = new Object[1];
         argList[0] = metaData.getId();

         IdentityStore store = (IdentityStore)ct.newInstance(argList);

         store.bootstrap(metaData);

         bootstrappedIdentityStores.put(store.getId(), store);
         bootstrappedAttributeStores.put(store.getId(), store);
      }

      // IdentityRepository

      Map<String, IdentityStoreRepository> bootstrappedRepositories = new HashMap<String, IdentityStoreRepository>();
View Full Code Here

            return resolveIdentityStore(identityObjectType).getSupportedFeatures().isIdentityObjectTypeSupported(identityObjectType);
         }

         public boolean isRelationshipTypeSupported(IdentityObjectType fromType, IdentityObjectType toType, IdentityObjectRelationshipType relationshipType) throws IdentityException
         {
            IdentityStore fromStore = resolveIdentityStore(fromType);

            IdentityStore toStore = resolveIdentityStore(toType);

            if (fromStore == toStore)
            {
               return fromStore.getSupportedFeatures().isRelationshipTypeSupported(fromType, toType, relationshipType);
            }
View Full Code Here

      return resolveIdentityStore(io.getIdentityType());
   }

   IdentityStore resolveIdentityStore(IdentityObjectType iot)
   {
      IdentityStore ids = getIdentityStore(iot);
      if (ids == null)
      {
         ids = defaultIdentityStore;
      }
      return ids;
View Full Code Here

   }

   public IdentityObject createIdentityObject(IdentityStoreInvocationContext invocationCtx, String name, IdentityObjectType identityObjectType) throws IdentityException
   {
      IdentityStore targetStore = resolveIdentityStore(identityObjectType);
      IdentityStoreInvocationContext targetCtx = resolveInvocationContext(targetStore, invocationCtx);
      return targetStore.createIdentityObject(targetCtx, name, identityObjectType);
   }
View Full Code Here

      return targetStore.createIdentityObject(targetCtx, name, identityObjectType);
   }

   public IdentityObject createIdentityObject(IdentityStoreInvocationContext invocationCtx, String name, IdentityObjectType identityObjectType, Map<String, String[]> attributes) throws IdentityException
   {
      IdentityStore targetStore = resolveIdentityStore(identityObjectType);
      IdentityStoreInvocationContext targetCtx = resolveInvocationContext(targetStore, invocationCtx);
      return targetStore.createIdentityObject(targetCtx, name, identityObjectType, attributes);
   }
View Full Code Here

      return targetStore.createIdentityObject(targetCtx, name, identityObjectType, attributes);
   }

   public void removeIdentityObject(IdentityStoreInvocationContext invocationCtx, IdentityObject identity) throws IdentityException
   {
      IdentityStore targetStore = resolveIdentityStore(identity);
      IdentityStoreInvocationContext targetCtx = resolveInvocationContext(targetStore, invocationCtx);

      targetStore.removeIdentityObject(targetCtx, identity);
   }
View Full Code Here

      targetStore.removeIdentityObject(targetCtx, identity);
   }

   public int getIdentityObjectsCount(IdentityStoreInvocationContext invocationCtx, IdentityObjectType identityType) throws IdentityException
   {
      IdentityStore targetStore = resolveIdentityStore(identityType);
      IdentityStoreInvocationContext targetCtx = resolveInvocationContext(targetStore, invocationCtx);

      return targetStore.getIdentityObjectsCount(targetCtx, identityType);
   }
View Full Code Here

TOP

Related Classes of org.jboss.identity.idm.spi.store.IdentityStore

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.