Package org.jboss.identity.idm.impl.cache

Examples of org.jboss.identity.idm.impl.cache.JBossCacheIdentityStoreWrapper


            {
               throw new IdentityException("JBoss Cache config file specified in option \"" + CACHE_CONFIG_FILE_OPTION +
                  "\" doesn't exist: " + cacheConfig);
            }

            defaultIdentityStore = new JBossCacheIdentityStoreWrapper(defaultIdentityStore, cacheConfigInputStream);


         }
      }

      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);

            if (cacheConfig == null)
            {
               throw new IdentityException(CACHE_CONFIG_FILE_OPTION + " is missing in the repository identity-store-mapping 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);
            }


            store = new JBossCacheIdentityStoreWrapper(store, cacheConfigInputStream);
         }

         if (store == null)
         {
            throw new IdentityException("Mapped IdentityStore not available: " + storeId);
View Full Code Here


               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);
View Full Code Here

            {
               throw new IdentityException("JBoss Cache config file specified in option \"" + CACHE_CONFIG_FILE_OPTION +
                  "\" doesn't exist: " + cacheConfig);
            }

            defaultIdentityStore = new JBossCacheIdentityStoreWrapper(defaultIdentityStore, cacheConfig);
         }
      }

      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);

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

            File cacheConfigFile = new File(cacheConfig);

            if(!cacheConfigFile.exists())
            {
               throw new IdentityException("JBoss Cache config file specified in option \"" + CACHE_CONFIG_FILE_OPTION +
                  "\" doesn't exist: " + cacheConfig);
            }

            store = new JBossCacheIdentityStoreWrapper(store, cacheConfig);
         }

         if (store == null)
         {
            throw new IdentityException("Mapped IdentityStore not available: " + storeId);
View Full Code Here

TOP

Related Classes of org.jboss.identity.idm.impl.cache.JBossCacheIdentityStoreWrapper

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.