1 19 package org.lucane.server.store; 20 21 import java.util.*; 22 import org.lucane.common.concepts.*; 23 import org.lucane.server.Server; 24 25 28 public abstract class GroupStore 29 { 30 35 public abstract boolean isInitialized() throws Exception ; 36 37 42 public abstract void storeGroup(GroupConcept group) throws Exception ; 43 44 49 public abstract void updateGroup(GroupConcept group) throws Exception ; 50 51 56 public abstract void removeGroup(GroupConcept group) throws Exception ; 57 58 64 public abstract GroupConcept getGroup(String name) throws Exception ; 65 66 71 public abstract Iterator getAllGroups() throws Exception ; 72 73 79 public Iterator getUsersFor(GroupConcept group) 80 throws Exception 81 { 82 ArrayList list = new ArrayList(); 83 84 UserStore us = Server.getInstance().getStore().getUserStore(); 85 Iterator users = us.getAllUsers(); 86 while(users.hasNext()) 87 { 88 UserConcept user = (UserConcept)users.next(); 89 Iterator groups = us.getAllUserGroups(user); 90 while(groups.hasNext()) 91 { 92 if(group.equals(groups.next())) 93 { 94 list.add(user); 95 break; 96 } 97 } 98 } 99 100 return list.iterator(); 101 } 102 } | Popular Tags |