Package org.jboss.identity.idm.common.exception

Examples of org.jboss.identity.idm.common.exception.IdentityException


               IdentitySearchCriteriaImpl.applyCriteria(identitySession, convertSearchControls(criteria), identities);
            }
         }
         catch (Exception e)
         {
            throw new IdentityException("Failed to apply criteria", e);
         }

         return identities;

      }
View Full Code Here


         //Handle only those credentials that implement SPI

         if (!(credential instanceof IdentityObjectCredential))
         {
            throw new IdentityException("Unsupported Credential implementation: " + credential.getClass());
         }

         ioc = (IdentityObjectCredential)credential;

         // All credentials must pass
View Full Code Here

      {
         getRepository().updateCredential(getInvocationContext(), createIdentityObject(user), (IdentityObjectCredential)credential);
      }
      else
      {
         throw new IdentityException("Unsupported Credential implementation: " + credential.getClass());
      }
   }
View Full Code Here

         Set<String> supportedAttrs = defaultAttributeStore.getSupportedAttributeNames(defaultCtx, identity.getIdentityType());
         for (IdentityObjectAttribute entry : leftAttrs)
         {
            if (!supportedAttrs.contains(entry.getName()))
            {
               throw new IdentityException("Cannot update not defined attribute. Use '"
                  + ALLOW_NOT_DEFINED_ATTRIBUTES + "' option to pass such attributes to default IdentityStore anyway." +
                  "Attribute name: " + entry.getName());
            }
         }
         defaultAttributeStore.updateAttributes(defaultCtx, identity, attributesToAdd);
View Full Code Here

         for (IdentityObjectAttribute entry : attributesToAdd)
         {
            // if we hit some unsupported attribute at this stage that we cannot store...
            if (!supportedAttrs.contains(entry.getName()))
            {
               throw new IdentityException("Cannot add not defined attribute. Use '"
                  + ALLOW_NOT_DEFINED_ATTRIBUTES + "' option to pass such attributes to default IdentityStore anyway." +
                  "Attribute name: " + entry.getName());
            }

         }
View Full Code Here

         Set<String> supportedAttrs = defaultAttributeStore.getSupportedAttributeNames(defaultCtx, identity.getIdentityType());
         for (String name : leftAttrs)
         {
            if (!supportedAttrs.contains(name))
            {
               throw new IdentityException("Cannot remove not defined attribute. Use '"
                  + ALLOW_NOT_DEFINED_ATTRIBUTES + "' option to pass such attributes to default IdentityStore anyway." +
                  "Attribute name: " + name);
            }
         }
         defaultAttributeStore.removeAttributes(defaultCtx, identity, leftAttrs.toArray(new String[leftAttrs.size()]));
View Full Code Here

   public void register(Object object, String name) throws IdentityException
   {
      if (!registry.register(name, object))
      {
          throw new IdentityException("Cannot register object in IdentityContext with name: " + name);
      }
      if (log.isLoggable(Level.FINER)) log.finer("registering object: " + name + " ; " + object.getClass());
   }
View Full Code Here

   public Object getObject(String name) throws IdentityException
   {
      Object o = registry.getRegistration(name);
      if (o == null)
      {
         throw new IdentityException("No such mapping in IdentityContext: " + name);
      }
      return o;
   }
View Full Code Here

         {
            storeClass = Class.forName(metaData.getClassName());
         }
         catch (ClassNotFoundException e)
         {
            throw new IdentityException("Cannot instantiate identity store:" + metaData.getClassName(), e);
         }
         Class partypes[] = new Class[1];
         partypes[0] = String.class;

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

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

         IdentityStoreConfigurationContext storeConfigurationCtx =
            new IdentityStoreConfigurationContextImpl(configMD, this, metaData);

         store.bootstrap(storeConfigurationCtx);

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

      // IdentityRepository

      Map<String, IdentityStoreRepository> bootstrappedRepositories = new HashMap<String, IdentityStoreRepository>();

      for (IdentityRepositoryConfigurationMetaData metaData : configMD.getRepositories())
      {
         Class repoClass = null;
         try
         {
            repoClass = Class.forName(metaData.getClassName());
         }
         catch (ClassNotFoundException e)
         {
            throw new IdentityException("Cannot instantiate identity store:" + metaData.getClassName(), e);
         }
         Class partypes[] = new Class[1];
         partypes[0] = String.class;

         Constructor ct = repoClass.getConstructor(partypes);
View Full Code Here

   public IdentitySession createIdentitySession(String realmName) throws IdentityException
   {

      if (!sessionContextMap.containsKey(realmName))
      {
         throw new IdentityException("Cannot find configured realm with a given name: " + realmName);
      }

      //IdentitySession session = new IdentitySessionImpl(realmName, repo, mapper);
      IdentitySessionConfigurationContext sessionConfigCtx = sessionContextMap.get(realmName);
View Full Code Here

TOP

Related Classes of org.jboss.identity.idm.common.exception.IdentityException

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.