1 12 13 package com.openedit.users.filesystem; 14 15 import java.io.Serializable ; 16 import java.util.Collection ; 17 import java.util.HashSet ; 18 import java.util.Set ; 19 20 import org.apache.commons.logging.Log; 21 import org.apache.commons.logging.LogFactory; 22 23 import com.openedit.users.Group; 24 import com.openedit.users.UserManagerException; 25 26 32 public class FileSystemGroup extends FileSystemObject implements Group, Serializable 33 { 34 protected long fieldLastModified; 35 36 private transient static Log log = null; 37 private Log getLog() 38 { 39 if( log == null) 40 { 41 log = LogFactory.getLog(FileSystemGroup.class); 42 } 43 return log; 44 } 45 46 protected Set fieldPermissions; 47 protected String fieldName; 48 49 57 public FileSystemGroup() 58 { 59 } 60 61 64 public String getName() 65 { 66 return fieldName; 67 } 68 69 72 public Collection getPermissions() 73 { 74 if (fieldPermissions == null) 75 { 76 fieldPermissions = new HashSet (); 77 } 78 return fieldPermissions; 79 } 80 83 public void addPermission(String inPermission) throws UserManagerException 84 { 85 getPermissions().add(inPermission); 86 } 87 88 89 92 public boolean hasPermission(String inPermission) 93 { 94 return getPermissions().contains(inPermission); 95 } 96 97 100 public void removePermission(String inPermission) 101 throws UserManagerException 102 { 103 getPermissions().remove(inPermission); 104 } 105 106 112 public String toString() 113 { 114 return getName(); 115 } 116 117 public void setName(String inGroupName) 118 { 119 fieldName = inGroupName; 120 } 121 122 public long getLastModified() 123 { 124 return fieldLastModified; 125 } 126 127 public void setLastModified(long inLastModified) 128 { 129 fieldLastModified = inLastModified; 130 } 131 132 } 133 | Popular Tags |