Package org.jboss.resteasy.keystone.model

Examples of org.jboss.resteasy.keystone.model.IdentityStore


      DEFAULT_MAPPER.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
   }

   public String export(Cache cache)
   {
      IdentityStore store = toStore(cache);
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      write(baos, store);
      return new String(baos.toByteArray());
   }
View Full Code Here


      }
   }

   public void importStore(InputStream is, Cache cache)
   {
      IdentityStore store = importStore(is);
      importStore(store, cache);
   }
View Full Code Here

      }
   }

   public void export(Cache cache, OutputStream os)
   {
      IdentityStore store = toStore(cache);
      write(os, store);

   }
View Full Code Here

   public IdentityStore toStore(Cache cache)
   {
      List<StoredUser> users = new ArrayList<StoredUser>();
      List<Role> roles = new ArrayList<Role>();
      List<StoredProject> projects = new ArrayList<StoredProject>();
      IdentityStore store = new IdentityStore();
      for (Object value : cache.values())
      {
         if (value instanceof StoredUser)
         {
            users.add((StoredUser) value);
            store.setUsers(users);
         } else if (value instanceof Role)
         {
            roles.add((Role) value);
            store.setRoles(roles);
         } else if (value instanceof StoredProject)
         {
            projects.add((StoredProject) value);
            store.setProjects(projects);
         }
      }
      return store;
   }
View Full Code Here

TOP

Related Classes of org.jboss.resteasy.keystone.model.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.