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

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


            String cacheConfig = configurationMD.getOptionSingleValue(CACHE_CONFIG_FILE_OPTION);
            String cacheSupportClass = configurationMD.getOptionSingleValue(CACHE_PROVIDER_CLASS_OPTION);

            if (cacheConfig == null)
            {
               throw new IdentityException(CACHE_CONFIG_FILE_OPTION + " is missing in the repository configuration");
            }

            if (cacheSupportClass == null)
            {
               throw new IdentityException(CACHE_PROVIDER_CLASS_OPTION + " is missing in the repository configuration");
            }

            ClassLoader classLoader = SecurityActions.getContextClassLoader();
            InputStream cacheConfigInputStream = classLoader.getResourceAsStream(cacheConfig);
            if (cacheConfigInputStream == null)
            {
               throw new IdentityException("JBoss Cache config file specified in option \"" + CACHE_CONFIG_FILE_OPTION +
                  "\" doesn't exist: " + cacheConfig);
            }



            try
            {
               Class cacheClass = null;
               cacheClass = Class.forName(cacheSupportClass);

               Class partypes[] = new Class[1];
               partypes[0] = InputStream.class;

               Constructor ct = cacheClass.getConstructor(partypes);
               Object argList[] = new Object[1];
               argList[0] = cacheConfigInputStream;


               IdentityStoreCacheProvider cacheSupport = (IdentityStoreCacheProvider)ct.newInstance(argList);

               defaultIdentityStore = new JBossCacheIdentityStoreWrapper(defaultIdentityStore, cacheSupport);


            }
            catch (Exception e)
            {
               throw new IdentityException("Cannot instantiate cache provider:" + cacheSupportClass, e);
            }



         }
      }

      for (IdentityStoreMappingMetaData identityStoreMappingMetaData : configurationMD.getIdentityStoreToIdentityObjectTypeMappings())
      {
         String storeId = identityStoreMappingMetaData.getIdentityStoreId();
         List<String> identityObjectTypeMappings = identityStoreMappingMetaData.getIdentityObjectTypeMappings();

         IdentityStore store = bootstrappedIdentityStores.get(storeId);

         String cacheOption = identityStoreMappingMetaData.getOptionSingleValue(CACHE_OPTION);


         if (cacheOption != null && cacheOption.equalsIgnoreCase("true"))
         {
            String cacheConfig = identityStoreMappingMetaData.getOptionSingleValue(CACHE_CONFIG_FILE_OPTION);
            String cacheSupportClass = identityStoreMappingMetaData.getOptionSingleValue(CACHE_PROVIDER_CLASS_OPTION);


            if (cacheConfig == null)
            {
               throw new IdentityException(CACHE_CONFIG_FILE_OPTION + " is missing in the repository identity-store-mapping configuration");
            }

            if (cacheSupportClass == null)
            {
               throw new IdentityException(CACHE_PROVIDER_CLASS_OPTION + " is missing in the repository configuration");
            }

            ClassLoader classLoader = SecurityActions.getContextClassLoader();
            InputStream cacheConfigInputStream = classLoader.getResourceAsStream(cacheConfig);
            if (cacheConfigInputStream == null)
            {
               throw new IdentityException("JBoss Cache config file specified in option \"" + CACHE_CONFIG_FILE_OPTION +
                  "\" doesn't exist: " + cacheConfig);
            }

            try
            {
               Class cacheClass = null;
               cacheClass = Class.forName(cacheSupportClass);

               Class partypes[] = new Class[1];
               partypes[0] = InputStream.class;

               Constructor ct = cacheClass.getConstructor(partypes);
               Object argList[] = new Object[1];
               argList[0] = cacheConfigInputStream;


               IdentityStoreCacheProvider cacheSupport = (IdentityStoreCacheProvider)ct.newInstance(argList);

               store = new JBossCacheIdentityStoreWrapper(store, cacheSupport);

            }
            catch (Exception e)
            {
               throw new IdentityException("Cannot instantiate cache provider:" + cacheSupportClass, e);
            }


         }

         if (store == null)
         {
            throw new IdentityException("Mapped IdentityStore not available: " + storeId);
         }

         for (String mapping : identityObjectTypeMappings)
         {
            identityStoreMappings.put(mapping, store);
View Full Code Here


         {
            return defaultIdentityStore;
         }
         else
         {
            throw new IdentityException("IdentityObjectType not mapped in the configuration: " + identityObjectType);
         }
      }

      return store;
   }
View Full Code Here

         {
            return defaultIdentityStore;
         }
         else
         {
            throw new IdentityException("IdentityObjectType not mapped in the configuration: " + identityObjectType);
         }
      }

      return store;
   }
View Full Code Here

      {
         roleType = getRepository().createRelationshipName(getInvocationContext(), name);
      }
      catch (OperationNotSupportedException e)
      {
         throw new IdentityException("Role management not supported");
      }

      return new SimpleRoleType(roleType);
   }
View Full Code Here

      {
         getRepository().removeRelationshipName(getInvocationContext(), name);
      }
      catch (OperationNotSupportedException e)
      {
         throw new IdentityException("Role management not supported");
      }
   }
View Full Code Here

            return new SimpleRoleType(name);
         }
      }
      catch (OperationNotSupportedException e)
      {
         throw new IdentityException("Role management not supported");
      }

      return null;
   }
View Full Code Here

         return types;
      }
      catch (OperationNotSupportedException e)
      {
         throw new IdentityException("Role management not supported");
      }

   }
View Full Code Here

         return types;

      }
      catch (OperationNotSupportedException e)
      {
         throw new IdentityException("Role management not supported", e);
      }

   }
View Full Code Here

         return types;

      }
      catch (OperationNotSupportedException e)
      {
         throw new IdentityException("Role management not supported");
      }

   }
View Full Code Here

   {
      checkNotNullArgument(id, "Group id");

      if (!GroupId.validateId(id))
      {
         throw new IdentityException("Provided group id is not valid: " + id + "; " +
            "Please use PersistenceManager.createGroupId() to obtain valid group id");
      }

      GroupId groupId = new GroupId(id);
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.